JavaScript的方法

基于微博API与Scrapy-Redis的城市情绪地图数据爬取实战 本文详细介绍了如何利用Python爬虫技术从微博平台获取用户发布内容,用于构建城市情绪地图的毕业设计项目。文章涵盖了微博API的调用、Scrapy-Redis分布式爬虫架构、数据清洗与存储、反爬虫策略应对以及情绪分析预处理等关键技术,提供了完整的代码实现和实战经验。python复制下载# items.py"""清洗文本数据"""if text:# 移除HTML标签# 移除多余空白字符"""解析微博日期格式""" 阅读详情
 

JavaScript的方法

以下的一些"方法"可用在JavaScript:


abs method

Returns the absolute value of its argument.

Syntax

abs(arg)

Applies to

Math

Examples

xxx Examples to be supplied.


acos method

Returns the arc cosine (in radians) of its argument.

Syntax

acos(arg)

Applies to

Math

Examples

xxx Examples to be supplied.

See also

  • asin, atan, cos, sin, tan methods

    alert method

    Displays an Alert dialog box with a message and an OK button.

    Syntax

    alert("message")

    The argument message is any string.

    Description

    Use the alert method to display a message that does not require a user decision. The message argument specifies a message that the dialog box contains.

    Applies to

    window

    Examples

    In the following example, the testValue function checks the name entered by a user in the text element of a form to make sure that it is no more than eight characters in length. This example uses the alert method to prompt the user of an application to enter a valid value.

    function testValue(textElement) {
       if (textElement.length > 8) {
          alert("Please enter a name that is 8 characters or less")
       }
    }
    You can call the testValue function in the onBlur event handler of a form's text element, as shown in the following example:
    Name: <INPUT TYPE="text" NAME="userName" onBlur="testValue(userName)">

    See also

  • confirm, prompt methods

    anchor method

    Causes the calling string object to be a named anchor by surrounding it with HTML anchor tags, <A NAME=...> </A>.

    Syntax

    string.anchor(name)

    The argument name can be any string.

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • link method

    asin method

    Returns the arc sine (in radians) of its argument.

    Syntax

    asin(arg)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • acos, atan, cos, sin, tan methods

    assign method

    Sets location.href so you don't have to type ".href" complements toString().

    Syntax

    assign()

    Description

    Do not call the assign method. It exists so you can use 'location=...' instead of 'location.href=...'. xxx Description to be supplied.

    Applies to

    location

    Examples

    xxx Examples to be supplied.


    atan method

    Returns the arc tangent (in radians) of its argument.

    Syntax

    atan(arg)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • acos, asin, cos, sin, tan methods

    back method

    Loads the previous URL in the history list.

    Syntax

    back()

    Description

    This method performs the same action as a user choosing the Back button in the Navigator. The back method is the same as go(-1).

    Applies to

    history

    Examples

    xxx Examples to be supplied.

    See also

  • forward, go methods

    big method

    Causes the calling string object to be displayed in big font by surrounding it with HTML big font tags, <BIG> and </BIG>.

    Syntax

    big()

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • fontsize, small methods

    blink method

    Causes the calling string object to blink by surrounding it with HTML blink tags, <BLINK> ... </BLINK>.

    Syntax

    blink()

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • bold, italics, strike methods

    blur method

    For password, text, and textArea, removes focus to the object.

    Syntax

    blur()

    Description

    Use the blur method to remove focus from a specific form element.

    Applies to

    password, text, textArea

    Examples

    xxx Examples to be supplied.

    See also

  • focus, select methods

    bold method

    Causes the calling string object to be displayed as bold by surrounding it with HTML bold tags, <B> ... </B>.

    Syntax

    bold()
    NOTE: For Beta4, use B() for this method.

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • blink, italics, strike methods

    ceil method

    Returns the least integer greater than or equal to its argument.

    Syntax

    ceil(arg)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • floor method

    charAt method

    Returns the character at the specified index.

    Syntax

    charAt(index)

    index is any integer from 0 to string.length() - 1.

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • indexOf, lastIndexOf methods

    clear method

    Clears the window.

    Syntax

    clear()

    Description

    xxx Description to be supplied.

    Applies to

    document

    Examples

    xxx Examples to be supplied.


    clearTimeout method

    Cancels a timeout that was set with the setTimeout method.

    Syntax

    clearTimeout(timeoutID)

    timeoutID is a timeout setting that was returned by a previous call to the setTimeout method.

    Description

    xxx Description to be supplied. Applies to

    window

    Examples

    xxx Examples to be supplied.

    See also

  • setTimeout

    click method

    Simulates a mouse click on the calling form element.

    Syntax

    click()

    Description

    The effect of the click method varies according to the calling element:

  • For button, reset, and submit, xxx.
  • For a radioButton, selects a radio button.
  • For a checkbox, checks the check box and sets its value to on.
  • For a selection, sets its value.

    Applies to

    button, checkbox, radioButton, reset, selection, submit

    Examples

    xxx Examples to be supplied.


    close method

    For document and window, closes the window. xxx Not yet implemented in Beta 4.

    Syntax

    close()

    Description

    Document description to be supplied.

    The close method closes the current window.

    Applies to

    document, window

    Examples

    Any of the following examples close the current window:

    window.close()
    self.close()
    close()

    See also

  • open method

    confirm method

    Displays a Confirm dialog box with the specified message and OK and Cancel buttons.

    Syntax

    confirm("message")

    The argument message is any string.

    Description

    Use the confirm method to ask the user to make a decision that requires either an OK or a Cancel. The message argument specifies a message that prompts the user for the decison. The confirm method returns true if the user chooses OK and false if the user chooses Cancel.

    Applies to

    window

    Examples

    This example uses the confirm method in the confirmCleanUp function to confirm that the user of an application really wants to quit. If the user chooses OK, the custom cleanUp() function closes the application.

    function confirmCleanUp() {
       if (confirm("Are you sure you want to quit this application?")) {
          cleanUp()
       }
    }
    You can call the confirmCleanUp function in the onClick event handler of a form's pushbutton, as shown in the following example:
    <INPUT TYPE="button" VALUE="Quit" onClick="confirmCleanUp()">

    See also

  • alert, prompt methods

    cos method

    Returns the cosine of its argument. The argument is in radians.

    Syntax

    cos(arg)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • acos, asin, atan, sin, tan methods

    eval function

    The eval function is a function built-in to JavaScript. It is not a method associated with any object, but is part of the language itself.

    Syntax

    eval(expression)

    Description

    The eval function takes a JavaScript arthimetic expression as its argument and returns the value of the argument as a number.

    Example

    Both of the uses of eval in the following example assign the value 42 to the variable result.

    x = 6
    result = eval((3+3)*7)
    result = eval(x*7)
    

    exp method

    Returns e to the power of its argument, i.e. ex, where x is the argument, and e is Euler's constant, the base of the natural logarithms.

    Syntax

    exp(arg)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • log method

    fixed method

    Causes the calling string object to be displayed in fixed-pitch font in HTML by surrounding it with typewriter text tags, <fixed> ... </fixed>.

    Syntax

    fixed()
    NOTE: For Beta4, use TT() for this method.

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.


    floor method

    Returns the greatest integer less than or equal to its argument.

    Syntax

    floor(arg)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • ceil method

    focus method

    For password, text, and textArea, gives focus to the object.

    Syntax

    focus()

    Description

    Use the focus method to navigate to a specific form element and give it focus. You can then either programatically enter a value in the element or let the user enter a value.

    Applies to

    password, text, textArea

    Examples

    In the following example, the checkPassword function confirms that a user has entered a valid password. If the password is not valid, the focus method returns focus to the password field and the select method highlights it so the user can re-enter the password.

    function checkPassword(userPass) {
       if (badPassword) {
          alert("Please enter your password again.")
          userPass.focus()
          userPass.select()
       }
    }
    This example assumes that the password is defined as:
    <INPUT TYPE=password NAME=userPass>

    See also

  • blur, select methods

    fontcolor method

    Causes the calling string object to be displayed in the specified color by surrounding it with HTML font color tags, <FONTCOLOR=color> ... </FONTCOLOR>.

    Syntax

    fontcolor(color)

    The argument to the method, color, must be a string containing a hashmark (#) followed by a triplet of hexadecimal number pairs. These three pairs represent the red, green, and blue values for the desired color, respectively.

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.


    fontsize method

    Causes the calling string object to be displayed in the specified font size by surrounding it with HTML font size tags, <FONTSIZE=size> ... </FONTSIZE>.

    Syntax

    fontsize(size)

    The argument to the method, size, must be an integer between one and seven.

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • big, small methods

    forward method

    Loads the next URL in the history list.

    Syntax

    forward()

    Description

    This method performs the same action as a user choosing the Forward button in the Navigator. The forward method is the same as go(1).

    Applies to

    history

    Examples

    xxx Examples to be supplied.

    See also

  • back, go methods

    getDate method

    Syntax

    dateObj.getDate()

    where dateObj is a date object.

    Description

    Returns the day of the month for the date object, an integer between 1 and 31.

    Applies to

    Date

    Examples

    The second statement below assigns the value 25 to the variable day, based on the value of the date object Xmas95.

    Xmas95 = new Date("December 25, 1995 23:15:00")
    day = Xmas95.getDate()
    

    See also

  • xxx To be supplied.

    getDay method

    Syntax

    dateObj.getDay()

    where dateObj is a date object.

    Description

    Returns the day of the week for the date object, an integer corresponding to the day of the week: zero for Sunday, one for Monday, two for Tuesday, and so on.

    Applies to

    Date

    Examples

    The second statement below assigns the value 1 to weekday, based on the value of the date object Xmas95. This is because December 25, 1995 is a Monday.

    Xmas95 = new Date("December 25, 1995 23:15:00")
    weekday = Xmas95.getDay()
    

    See also

  • xxx To be supplied.

    getHours method

    Syntax

    dateObj.getHours()

    where dateObj is a date object.

    Description

    Returns the hour for the date object, an integer between 0 and 23.

    Applies to

    Date

    Examples

    The second statement below assigns the value 23 to the variable hours, based on the value of the date object Xmas95.

    Xmas95 = new Date("December 25, 1995 23:15:00")
    hours = Xmas95.getHours()
    

    See also

  • xxx To be supplied.

    getMinutes method

    Syntax

    dateObjgetMinute()

    where dateObj is a date object.

    Description

    Returns the minutes in the date object, an integer between 0 and 59.

    Applies to

    Date

    Examples

    The second statement below assigns the value 15 to the variable minutes, based on the value of the date object Xmas95.

    Xmas95 = new Date("December 25, 1995 23:15:00")
    minutes = Xmas95.getMinutes()
    

    See also

  • xxx To be supplied.

    getMonth method

    Syntax

    dateObj.getMonth()

    where dateObj is a date object.

    Description

    Returns the month in the date object, an integer between zero and eleven. Zero corresponds to January, one to Februrary, and so on.

    Applies to

    Date

    Examples

    The second statement below assigns the value 11 to the variable month, based on the value of the date object Xmas95.

    Xmas95 = new Date("December 25, 1995 23:15:00")
    month = Xmas95.getDate()
    

    See also

  • xxx To be supplied.

    getSeconds method

    Syntax

    dateObj.getSeconds()

    where dateObj is a date object.

    Description

    Returns the seconds in the current time, an integer between 0 and 59.

    Applies to

    Date

    Examples

    The second statement below assigns the value 30 to the variable secs, based on the value of the date object Xmas95.

    Xmas95 = new Date("December 25, 1995 23:15:30")
    secs = Xmas95.getSeconds()
    

    See also

  • xxx To be supplied.

    getTime method

    Syntax

    dateObj.getTime()

    where dateObj is a date object.

    Description

    Returns the numeric value for the date object. This number is the number of milliseconds since the epoch (1 January 1970 00:00:00) You can use this method to help assign a date and time to another date object.

    Applies to

    Date

    Examples

    The following example assigns the date value of theBigDay to sameAsBigDay.

    theBigDay = new Date("July 1, 1999")
    sameAsBigDay = new Date();
    sameAsBigDay.setTime(theBigDay.getTime())
    

    See also

  • xxx To be supplied.

    getTimezoneOffset method

    Syntax

    dateObj.getTimezoneOffset()

    where dateObj is a date object.

    Description

    Return the time zone offset in minutes for the current locale, i.e. the difference between the local time and GMT. This value would be a constant except for daylight savings time.

    Applies to

    Date

    Examples

    x = new Date();
    currentTimeZoneOffsetInHours = x.getTimezoneOffset()/60;
    

    See also

  • xxx To be supplied.

    getYear method

    Syntax

    getyear()

    Description

    Returns the year in the date object, less 1900.

    Applies to

    Date

    Examples

    The second statement below assigns the value 95 to the variable year, based on the value of the date object Xmas95.

    Xmas95 = new Date("December 25, 1995 23:15:00")
    year = Xmas95.getYear()
    

    See also

  • xxx To be supplied.

    go method

    The argument delta is an integer. If delta  is greater than zero, then it loads the URL that is that number of entries forward in the history list; otherwise, it loads the URL that is that number of entries backward in the history list.

    The argument string is a string. Go to the newest history entry whose title or URL contains string as a substring; substring matching is case-insensitive.

    Syntax

    go(delta | "string")

    Description

    xxx Description to be supplied.

    Applies to

    history

    Examples

    xxx Examples to be supplied.

    See also

  • back, forward methods

    indexOf method

    Returns the index within the calling string object of the first occurrence of the specified character, starting the search at fromIndex.

    Syntax

    indexOf(character, [fromIndex])

    character is the character to search for.
    fromIndex is the location within the calling string to start the search from, any integer from 0 to string.length() - 1.

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • charAt, lastIndexOf methods

    italics method

    Causes the calling string object to be italicized by surrounding it with HTML italics tags, <I> ... </I>.

    Syntax

    italics()
    NOTE: For Beta4, use I() for this method.

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • blink, bold, strike methods

    lastIndexOf method

    Returns the index within the calling string object of the last occurrence of the specified character. The calling string is searched backwards, starting at fromIndex.

    Syntax

    indexOf(character, [fromIndex])

    character is the character to search for.
    fromIndex is the location within the calling string to start the search from, any integer from 0 to string.length() - 1.

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • charAt, indexOf methods

    link method

    Causes the calling string object to be a hyperlink by surrounding it with HTML hyperlink tags, <A HREF=...> </A>.

    Syntax

    link(location)
    The argument to the method, location, should be a valid URL.

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • anchor method

    log method

    Returns the natural logarithm (base e) of its argument.

    Syntax

    log(arg)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • exp method

    max method

    Returns the greater of its two arguments.

    Syntax

    max(arg1, arg2)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • min method

    min method

    Returns the lesser of its two arguments.

    Syntax

    min(arg1, arg2)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • max method

    open method

    For the window object, opens a new web browser window. xxx For the document object, description to be supplied.

    Syntax

    The first form of the syntax is for the document object; the second form is for window.

    1. document.open("MIME type")
    2. window.open("URL", "windowName", ["windowFeatures"])

    URL specifies the URL to open in the new window.
    windowName specifies a name for the window object being opened.
    windowFeatures is a comma-separated list of any of the following options and values:

       toolbar[=yes|no]|[=1|0]
       location[=yes|no]|[=1|0]
       directories[=yes|no]|[=1|0]
       status[=yes|no]|[=1|0]
       menubar[=yes|no]|[=1|0]
       scrollbars[=yes|no]|[=1|0]
       resizable[=yes|no]|[=1|0]
       copyhistory[=yes|no]|[=1|0]
       width=pixels
       height=pixels
    

    You may use any subset of these options. Separate options with a comma. Do not put spaces between the options.

    pixels is a positive integer specifying the dimension in pixels.

    NOTE: In event handlers, you must specify window.open() unless you want to call document.open() because of the scoping of static objects in JavaScript.

    Description for window

    The open method opens a new web browser window on the client, similar to choosing File|New Web Browser from the menu of the Navigator. The URL argument specifies the URL contained by the new window. If URL is an empty string, a new, empty window is created.

    windowFeatures is an optional, comma-separated list of options for the new window. The boolean windowFeatures options are set to true if they are specified without values, or as yes or 1. For example, open("", "messageWindow", "toolbar") and open("", "messageWindow", "toolbar=1") both set the toolbar option to true. If windowName does not specify an existing window and you do not specify windowFeatures, all boolean windowFeatures are true by default.

    Following is a description of the windowFeatures:

  • toolbar creates the standard Navigator toolbar, with buttons such as "Back" and "Forward", if true
  • location creates a Location entry field, if true
  • directories creates the standard Navigator directory buttons, such as "What's New" and "What's Cool", if true
  • status creates the status bar at the bottom of the window, if true
  • menubar creates the menu at the top of the window, if true
  • scrollbars creates horizontal and vertical scrollbars when the document grows larger than the window dimensions, if true
  • resizable allows a user to resize the window, if true
  • copyhistory gives the new window the same session history as the current window, if true
  • width specifies the width of the window in pixels
  • height specifies the height of the window in pixels

    Description for document

    Description to be supplied.

    Applies to

    document, window

    Examples

    In the following example, the windowOpener function opens a window and uses write methods to display a message:

    function windowOpener() {
       msgWindow=open("","Display window","toolbar=no,directories=no,menubar=no");
       msgWindow.document.write("<HEAD><TITLE>Message window</TITLE></HEAD>");
       msgWindow.document.write("<CENTER><BIG><B>Hello, world!</B></BIG></CENTER>");
    }
    

    The following is an onClick event handler that opens a new client window displaying the content specified in the file sesame.html. It opens it with the specified option settings and names the corresponding window object newWin.

      &lt;FORM NAME="myform"&gt; &lt;INPUT TYPE="button" NAME="Button1" VALUE="Open Sesame!" onClick="window.open('sesame.html', 'newWin', 'toolbar=no,directories=no,menubar=no,status=yes,width=300,height=300')"&gt; &lt;/form&gt; 
     

    Notice the use of single quotes (') inside the onClick event handler.

    See also

  • close method

    parse method

    Syntax

    Date.parse(date string)

    Description

    The parse function takes a date string (such as "Dec 25, 1995"), and returns the number of milliseconds since January 1, 1970 00:00:00 (local time). This function is useful for setting date values based on string values, for example in conjunction with the setTime method.

    Given a string representing a time, parse returns the time value. It accepts the IETF standard date syntax: "Mon, 25 Dec 1995 13:30:00 GMT". It understands the continental US time zone abbreviations, but for general use, use a time zone offset, for example "Mon, 25 Dec 1995 13:30:00 GMT+0430" (4 hours, 30 minutes west of the Greenwich meridian). If you do not specify a time zone, the local time zone is assumed. GMT and UTC are considered equivalent.

    The parse function is a static method of Date. That means that you always use it as Date.parse(), rather than as a method of a date object you created.

    Applies to

    Date

    Examples

    If IPOdate is an existing date object, then

    IPOdate.setTime(Date.parse("Aug 9, 1995"))
    

    See also

  • UTC method

    pow method

    Returns arg1 to the arg2 power, i.e. arg1arg2.

    Syntax

    pow(arg1, arg2)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • sqrt method

    prompt method

    Displays an Prompt dialog box with a message and an input field

    Syntax

    prompt(message, input default)

    Description

    Use the prompt method to display a dialog box that takes user input. The arguments, message and input default are JavaScript values to be displayed as the message and the default value in the input field, respectively.

    Applies to

    window

    Examples

    prompt("Enter the number of doughnuts you want:", 12)
    

    See also

  • alert, confirm methods

    random method

    Returns a pseudo-random number between zero and one. xxx NYI.

    Syntax

    xxx To be supplied.

    Applies to

    Math

    Examples

    xxx Examples to be supplied.


    round method

    Returns its argument, rounded to the nearest integer. In other words, if its argument is n.5 or greater (where n is an integer), returns n+1, otherwise returns n.

    Syntax

    round(arg)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.


    select method

    For password, text, and textArea, selects the input area of the object.

    Syntax

    select()

    Description

    Use the select method to highlight the input area of a form element. You can use the select method with the focus method to highlight a field and position the cursor for a user response.

    Applies to

    password, text, textArea

    Examples

    In the following example, the checkPassword function confirms that a user has entered a valid password. If the password is not valid, the select method highlights the password field and focus method returns focus to it so the user can re-enter the password.

    function checkPassword(userPass) {
       if (badPassword) {
          alert("Please enter your password again.")
          userPass.focus()
          userPass.select()
       }
    }
    This example assumes that the password is defined as:
    <INPUT TYPE=password NAME=userPass>

    See also

  • blur, focus methods

    setDate method

    Syntax

    dateObj.setDate(day)

    where dateObj is a date object.

    Description

    Sets the day of the month for the date object. The argument is an integer from 1 to 31.

    Applies to

    Date

    Examples

    The second statement below changes the day for theBigDay to the 24th of July from its original value.

    theBigDay = new Date("July 27, 1962 23:30:00")
    Xmas95.setDate(24)
    

    See also

  • xxx To be supplied.

    setHours method

    Syntax

    dateObj.setHours(hours

    where dateObj is a date object.

    Description

    Sets the hours in the current time. The argument is an integer between 0 and 23.

    Applies to

    Date

    Examples

    theBigDay.setHours(7)
    

    See also

  • xxx To be supplied.

    setMinutes method

    Syntax

    dateObj.setMinutes(minutes)

    where dateObj is a date object.

    Description

    Sets the minutes in the current time. The argument is an integer between 0 and 59.

    Applies to

    Date

    Examples

    theBigDay.setMinutes(45)
    

    See also

  • xxx To be supplied.

    setMonth method

    Syntax

    dateObj.setMonth(month)

    where dateObj is a date object.

    Description

    Sets the month in the current date. The argument is an integer between 0 and 11.

    Applies to

    Date

    Examples

    theBigDay.setMonth(6)
    

    See also

  • xxx To be supplied.

    setSeconds method

    Syntax

    dateObj.setSeconds(seconds)

    where dateObj is a date object.

    Description

    Sets the seconds in the current time. The argument is an integer between 0 and 59.

    Applies to

    Date

    Examples

    theBigDay.setSeconds(30)
    

    See also

  • xxx To be supplied.

    setTime method

    Syntax

    dateObj.setTime(timevalue)

    where dateObj is a date object.

    Description

    Sets the value of the date object. This argument is the number of milliseconds since the epoch (1 January 1970 00:00:00) You can use this method to help assign a date and time to another date object.

    Applies to

    Date

    Examples

    theBigDay = new Date("July 1, 1999")
    sameAsBigDay = new Date();
    sameAsBigDay.setTime(theBigDay.getTime())
    

    setTimeout method

    Evaluates an expression after a specified number of milliseconds have elapsed.

    Syntax

    timeoutID=setTimeout(expression, msec)

    expression is a string expression.
    msec is a numeric value or numeric string in millisecond units.
    timeoutID is an identifier that is used only to cancel the evaluation with the clearTimeout method.

    Description

    xxx Description to be supplied. Applies to

    window

    Examples

    xxx Examples to be supplied.

    See also

  • clearTimeout

    setYear method

    Syntax

    dateObj.setYear(year)

    where dateObj is a date object.

    Description

    Sets the year in the current date. Takes as its argument an integer greater than 1900.

    Applies to

    Date

    Examples

    theBigDay.setYear(96)
    

    See also

  • xxx To be supplied.

    sin method

    Returns the sine of its argument. The argument is in radians.

    Syntax

    sin(arg)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • acos, asin, atan, cos, tan methods

    small method

    Causes the calling string object to be displayed in small font by surrounding it with HTML small font tags, <SMALL>...</SMALL>.

    Syntax

    small()

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • big, fontsize methods

    sqrt method

    Returns the square root of its argument.

    Syntax

    sqrt(arg)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • pow method

    strike method

    Causes the calling string object to be displayed as struck out text, by surrounding it with HTML strikeout tags, <STRIKE> ... </STRIKE>.

    Syntax

    strike()

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • blink, bold, italics methods

    sub method

    Causes the calling string object to be displayed as a subscript by surrounding it with HTML subscript tags, <SUB> ... </SUB>.

    Syntax

    sub()

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    sup method


    submit method

    Submits the form.

    Syntax

    submit()

    Description

    xxx Description to be supplied.

    Applies to

    form

    Examples

    xxx Examples to be supplied.


    substring method

    The substring method returns a subset of a string object. If a < b, then it returns the subset starting at character a and ending before character b, considering the first character of the string to be character zero (0). If a > b, then it returns the subset starting at character b and ending at character a. If a = b, then it returns the empty string.

    Syntax

    substring(a, b)

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    If string x is "netscape" then x.substring(0,3) or x.substring(3,0) returns "net", and x.substring(4,7) or x.substring(7,4) returns "cap".


    sup method

    Causes the calling string object to be displayed as a superscript by surrounding it with HTML superscript tags, <SUP> ... </SUP>.

    Syntax

    sup()

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    xxx Examples to be supplied.

    See also

  • sub method

    tan method

    Returns the tangent of its argument. The argument is in radians.

    Syntax

    tan(arg)

    Applies to

    Math

    Examples

    xxx Examples to be supplied.

    See also

  • acos, asin, atan, cos, sin methods

    toGMTString method

    Syntax

    dateObj.toGMTString()

    where dateObj is a date object.

    Description

    Converts a date to a String, using the Internet GMT conventions.

    Applies to

    Date

    Examples

    today.toGMTString()
    

    If today is a date object, then toGMTString would convert the date to GMT (UTC) using the operating system's time zone offset, and return a string value in the following form:
    Mon, 18 Dec 1995 17:28:35 GMT


    toLocaleString method

    Syntax

    dateObj.toLocaleString()

    where dateObj is a date object.

    Description

    Converts a date to a String, using the locale conventions.

    Applies to

    Date

    Examples

    today.toLocaleString()
    

    If today is a date object, then toLocaleString will return a string value in the following form:
    12/18/95 17:28:35


    toLowerCase method

    The toLowerCase method of string objects converts the string to all upper case.

    Syntax

    toLowerCase()

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    For example, "ALPHABET".toLowerCase yields "alphabet".

    See also

  • toUpperCase method

    toString method

    For location, returns location.href, so you can use location as a string without typing ".href". For Date, converts a date to a string.

    Syntax

    toString()

    Description

    xxx Description to be supplied.

    Applies to

    location, Date methods

    Examples

    Here is an example of using toString with a date object, assuming theBigDay is a date object:

    theBigDay.toString()
    

    More Examples to be supplied.


    toUpperCase method

    The toUpperCase method of string objects converts the string to all upper case.

    Syntax

    toUpperCase()

    Description

    xxx Description to be supplied.

    Applies to

    string

    Examples

    For example, "alphabet".toUpperCase yields "ALPHABET".

    See also

  • toLowerCase method

    UTC method

    Syntax

    Date.UTC(year, month, mday [, hrs] [, min] [, sec])

    Description

    UTC takes comma-delimited date parameters and returns the number of milliseconds since January 1, 1970 00:00:00, Universal Coordinated Time (GMT). The arameters are:

    • year - a year after 1900
    • month - a month between 0-11
    • date - day of the month between 1-31
    • hrs - hours between 0-23
    • min - minutes between 0-59
    • sec - seconds between 0-59

    UTC is a static method of Date. That means that you always use it as Date.UTC(), rather than as a method of a date object you created.

    Applies to

    Date

    Examples

    The following statement creates a date object using GMT instead of local time:

    gmtDate = new Date(Date.UTC(96, 11, 1, 0, 0, 0))
    

    See also

  • parse method

    write method

    Write HTML to the current window, in sequence with the HTML containing this SCRIPT. SCRIPTs have no effect on paragraphs or other structures in which they may occur.

    Syntax

    write()

    Description

    xxx Description to be supplied.

    Applies to

    document

    Examples

    xxx Examples to be supplied.

    See also

  • writeln method

    writeln method

    The same as write(), but adds a newline character. Note that this affects only preformatted text (inside a <PRE> or <XMP> tag).

    Syntax

    writeln()

    Description

    xxx Description to be supplied.

    Applies to

    document

    Examples

    xxx Examples to be supplied.

    See also

    • write method
    文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况 主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。 立即下载

    相关推荐

    运放+三极管恒流源电路设计实战:从原理到仿真一步到位(附Multisim文件)

    本文详细解析了运放与三极管构建恒流源电路的核心原理,重点阐述了负反馈机制如何实现精准的电流控制。通过Multisim仿真实战,从电路搭建、参数计算到负载调整率与动态响应分析,一步步指导设计过程,并提供常见故障的调试技巧与PCB设计要点,帮助工程师从理论平稳过渡到可靠实践。

    7z8x2c4v6b9的博客 711

    #考试酷#A1_Variable Names

    1. 考点:变量命名的规则 变量名的开头必须是字母或下划线,不能是数字。实际编程中最常用的是以字母开头,而以下划线开头的变量名是系统专用的。 变量名中的字母是区分大小写的。比如 a 和 A 是不同的变量名,num 和 Num 也是不同的变量名。 变量名绝对不可以是C语言关键字 变量名中不能有空格。这个可以这样理解:因为上面我们说过,变量名是字母、数字、下划线的组合,没有空格这一项。 c语言有...

    celeste0730的博客 1156

    LSF0108 level shift设计使用及debug流程

    目录 初版设计 测试出现的问题1 解决问题(尝试1) 测试出现的问题2 解决问题2-1 解决问题2-2 单Port测试结果 所有Port均连接测试结果 初版设计 此电路的应用场景在于将LCD屏幕连接到FPGA上,进而通过FPGA中设计的硬件电路来驱动LCD屏幕,验证数字硬件电路设计的正确性。因此需要一个转接板位于FPGA和LCD屏幕之间,将二者连接起来。 转接板的硬件电路设计主要存在以下需求: 实现3.3V和1.8V之间的同时双向逻辑转换(LCD屏幕电平为3.3V,FPGA电平为1.

    moshanghongfeng的博客 7562

    SPSS提示“列表中不允许存在字符串变量”的解决方法

    今天用SPSS对一些数据进行主成分分析,SPSS 19.0进行主成分分析的方法是:分析——降维——因子分析,但是当导入一些变量的时候,就会弹出窗口说“列表中不允许存在字符串变量”,可以点击:视图——变量,看到各个变量的类型,发现确实有些变量是字符串类型的,我的数据是以csv格式保存的,但SPSS在导入的时候就可能出现问题。如果直接在“变量”这一界面下修改类型,将会导致变量的值发生变化(例如我这里从

    qysh123的专栏 10万+

    【深度学习】肺结节分割项目实战一:处理数据集

    一、LIDC-IDRI数据集简介 官方网站 肺图像数据库协会的图像收集(LIDC-IDRI)包括诊断和带有病变注释标记的肺癌筛查胸部CT。这是一个网络公开的国际资源,用于肺癌检测和诊断的计算机辅助诊断(CAD)方法的开发、培训和评估。 数据集包含1018个病例,每个病例包括来自临床胸部CT扫描的图像和一个相关的XML文件,该文件记录了由四名经验丰富的胸部放射科医生进行的两阶段图像注释过程的结果。在最初的盲读阶段,每个放射科医生独立审查每个CT扫描,并标记出属于三种类型之一的病变(“结节>= 3mm”,

    weixin_42182906的博客 1万+

    COMSOL仿真教程—激光烧蚀

    本例使用二维模型,将来自激光的入射热通量模拟为金属表面上空间分布的热源,从而得到金属的烧蚀过程和瞬态温度分布。

    qq_40977332的博客 2万+

    hive学习笔记

    1.HIVE结构 Hive 是建立在 Hadoop 上的数据仓库基础构架。它提供了一系列的工具,可以用来进行数据提取转化加载(ETL),这是一种可以存储、查询和分析存储在 Hadoop 中的大规模数据的机制。Hive 定义了简单的类 SQL 查询语言,称为 QL,它允许熟悉 SQL 的用户查询数据。同时,这个语言也允许熟悉 MapReduce 开发者的开发自定义的 mapper 和 reduc...

    hyshucom 1179

    ESP32 BLE Mesh Provisioner实战:手把手教你用ESP-IDF配网智能灯泡(附常见错误排查)

    本文提供了一份基于ESP-IDF的ESP32 BLE Mesh Provisioner实战指南,详细解析了配网器的核心角色与工作流程。文章手把手教你从工程搭建、代码初始化到核心回调解析,并重点针对常见的‘Model not bound to AppKey’等错误提供了深度排查思路与解决方案,帮助你构建一个稳定可靠的智能照明网关。

    desk3的博客 513

    python variable name_如何修复名称错误:未定义名称“variablename”?

    所以我得到了一个错误名称错误:名称'chris'没有被定义,我怀疑它与全局和局部变量有关,但是我已经在函数中声明'chris'为全局变量。在代码如下:def ChrisFood():global chrischris = 1FoodSelection()def JoshFood():global joshjosh = 1FoodSelection()def SamFood():global sam...

    weixin_33751984的博客 1075

    YOLOv8环境搭建+训练自己的数据详细项目

    直接按照路径会有问题,找到自己 requirements.txt 文件路径,我这里是pip install -r D:\ultralytics-main\ultralytics-main\requirements.txt。首先去自己的anaconda的安装的envs(虚拟环境),在导航栏输入cmd,进入命令窗口。到官方网站下载yolo模型 ,下载好后解压,里面有个文件requirements.txt。然后安装ultralytics ,这是必须的。

    m0_63172128的博客 2万+

    031、速度前馈与加速度前馈

    摘要: 本文通过追剪机调试案例,阐述了速度前馈和加速度前馈在运动控制中的关键作用。前馈不是高级技巧,而是解决动态响应问题的必要手段:速度前馈通过预测速度变化提前补偿,加速度前馈则针对惯量变化提供力矩补偿。实现时需注意信号平滑处理,避免噪声放大。前馈与PID分工明确,前馈承担主要动态响应,PID处理残余误差。调试应先调前馈再微调PID,前馈增益需计算而非仅凭参数调整,并允许适当残余误差。前馈作为开环补偿不会影响系统稳定性,但需配合平滑的指令生成器使用。(149字)

    m0_50546716的博客 284

    CheckStyle报错的常见问题及解决方式

    CheckStyle报错的常见问题及解决方式

    5万+

    Ardupilot无人船(车)mavros自主控制

    rover 4.4。

    超维空间科技的博客 3229

    JS-JAVASCRIPT的eval()方法

    Lodop的传统模版是JS语句,如果储存的这种JS模版,可用javascript的eval()方法获取,该方法属于JS的范畴,并不是lodop语句,由于这个方法很多程序员可能不常用,对于这个JS方法不是特别了解,这里介绍一下这个JS方法。 JavaScript eval() 函数语法:eval(string)描述:eval() 函数可计算某个字符串,并执行其中的的 JavaScript 代码。 ...

    weixin_30610755的博客 213

    efm32 入门.pdf

    本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

    WINCC7.3破解文件

    WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

    JavaScript-JS数组方法有哪些

    join() reveres() sort() concat() slice() splice() push()和pop() unshit()和shit() toString和toLocaleString() forEach() map() filter() every和some() reduce()和reduceRight()

    hnyanzijun1的博客 1092

    IEM模型,地表粗糙度模拟

    利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

    【JavaScript】盘点js中数组的操作方法

    JavaScript数组的操作方法

    一条有梦想的咸鱼 1426

    Probability and Statistics - 4th edition

    Probability and Statistics - 4th edition

    JavaScript 多重方法库——multimethod-js

    JavaScript 多重方法库——multimethod-js 1. 项目基础介绍 multimethod-js 是一个为 JavaScript 设计的多重方法库,它基于 Clojure 的多重方法概念。这个库提供了一种功能性的编程结构,允许开发者在运行时动态构建和操纵多态函数的调度行为。该项目的编程语言为 JavaScript,可通过 npm 进行安装使用。 2. 项目核心功能 multime...

    gitblog_00779的博客 380

    原生js源码之JavaScript的call方法,自己来实现

    js的call方法非常强大,说的通俗点,就是可以借窝下蛋,这次就先来看看call方法是什么作用,如何使用,然后在模拟一下call方法。 先看一下语法:call([thisObj[,arg1[, arg2[, [,.argN]]]]]) 参数 thisObj 可选项。将被用作当前对象的对象(如果没有传、null、undefined 都会被默认为全局对象)。 arg1, arg2, , argN 可选项。将被传递方法参数序列。 下面来看一下具体用法 var person={ ...

    编程界明世隐的博客 1521

    【JavaScript】——JS数组的方法(全且详细)

    js数组中的方法

    qq_50497708的博客 5209

    js调用java方法_JavaScript中如何调用Java方法

    在JavaScript中想要调用Java的方法,我通过JavaScript访问servlet,再通过servlet调用Java某个类的方法。HTML代码全选图片名称价格款式 ///ShopShoesDao.javapublic void deleteFromCart(String shoes_id) {System.out.println("ShopShoesDao.dele...

    weixin_39551366的博客 1913

    Vue.js 中 v-for 指令与 JavaScript 数组方法

    Vue.js 中 v-for 指令与 JavaScript 数组方法

    一起coding,一起嗨。 1150

    [JavaScript]JS调用PHP和PHP调用JS的方法举例

    1、JS方式调用PHP文件并取得PHP中的值 举一个简单的例子来说明: 如在页面test_json1中用下面这句调用: alert(jstext); 在test_json2.php中有这样一段PHP代码: <?php $php_test='I come from PHP!'; echo "var test='$php_test';"; echo "var js

    汪海的实验室 4万+

    JavaScript js JS 数组方法介绍总结及其使用

    JavaScript JS 数组 最常用的数据结构 方法 声明和初始化数组,给数组赋值,以及添加和删除数组元素,二维数组,ES6 新增数组常用方法,示例,练习。

    ccq的博客 1456

    JavaScript(十七)JS的四种继承方法

    JS作为面向对象的弱类型语言,继承也是其非常强大的特性之一。JS面向对象知识中,继承是比较难比较抽象的一块内容,而且实现继承有很多种方法,每种方法又各有优缺点,需要对面向对象知识中的对象、原型、原型链、构造函数等基础知识掌握透彻,下面我们介绍四种继承的方法:原型链继承,构造继承,实例继承,组合继承。 既然要实现继承,那么首先我们得有一个父类,代码如下: /*先定义一个父类对象*/ ...

    We_jia的博客 253

    【转】C#中webbrowser与javascript(js)交互的方法

    今天在做一个项目的时候需要用c#搞一个webbrowser,然后有些地方还需要与js交互。所以就查了一下资料,发现很多博客提到了但是却没有说下具体的操作。所以我就写一下. 开发环境是Visual Studio 2008 .阅读此文需要有C#和javascript开发基础。 1.首先新建一个项目,在默认窗体form1上拖拽一个webbrowser1. 2.给form1的Load时间事件添加如下代码:...

    qq_24249071的博客 918

    【JavaScript】图解JS中的字符串方法

    详细介绍js中关于字符串的各个方法。

    m0_59873661的博客 2306
    上一篇: JavaScript 的对象属性
    下一篇: 事件处理
    spirityj
    博客等级 码龄22年 0粉丝 29原创
    评论
    成就一亿技术人!
    拼手气红包6.0元
    还能输入1000个字符
     
     条评论被折叠 查看
    添加红包

    请填写红包祝福语或标题

    个

    红包个数最小为10个

    元

    红包金额最低5元

    当前余额3.43元 前往充值 >
    需支付:10.00元
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付元
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值