SoFunction
Updated on 2025-04-14

Necessary Javascript programming_JS Syntax Dictionary Page 2/2


41. Define date variables: var today = new Date();
42. Date function list: () get time, () get year, () get four digits of year, () get month, () get day, () get day, () get hour, () get minutes, () get seconds, (value) set time, (val) set year, (val) set month, (val) set day, (val) set day, (val) set day, (val) set minute, (val) set seconds    [Note: This date and time starts from 0]
The representation method: [window.]frames[n].ObjFuncVarName,frames["frameName"].ObjFuncVarName,
Represents the father object, top represents the top object
45. The parent window that opens the child window is: opener
46. ​​Indicates the current location: this
47. When calling JS functions in a hyperlink, use: (javascript:) to start with the function name after adding the function name
48.Don't execute this JS in old browsers:<!--      //-->
49. Quote a file-based JS:<script type="text/javascript" src="/blog/"></script>
50. Specify HTML displayed in browsers that do not support scripts: <noscript></noscript>
51. When both hyperlink and onCLICK events are present, the old version of the browser will turn, otherwise turn. Example: <a href="/blog/" onclick="="/blog/";return false">dfsadf</a>
The built-in objects are: Array, Boolean, Date, Error, EvalError, Function, Math, Number, Object, RangeError, ReferenceError, RegExp, String, SyntaxError, TypeError, URIError
Line break in:\n
54. Window full screen size: <script>function fullScreen(){ (0,0);=;=;}=fullScreen;</script>
All in it represents all elements below it
Focus order in: ("form element").tabIndex = 1
The value of the form element is the value: if <p >"how are <em>you</em>"</p>, then the innerHTML value is: how are <em>you</em>
The value of the above is the same, but the mark is not displayed.
It can set whether the element can be modified, and isContentEditable returns the state of whether it can be modified.
Determine whether it is a prohibited state.disabled sets a prohibited state
Get the length and return the integer value
() is an external function file called by JS, with an extension of .htc
() Make the current window ahead of all windows.
() refers to losing focus. In contrast to FOCUS().
() means that the element is selected.
66. Prevent users from entering text into text boxes: onfocus="()"
67. Remove the number of occurrences of this element in the page: ("div (or other HTML tag)").length
It is divided into two forms outputs: modal and non-modal. (), ()
69. Settings of status column text: ='Text', default status column text settings: = 'Text.';
70. Add to favorites:("";,"jaskdlf");
Do not do any operation when encountering a script error: = doNothing; The syntax for specifying the error handle is: = handleError;
Specifies the parent window of the currently open window:, supports multiple continuations of...
The self in it refers to the current window
The content is displayed in the status bar:="Content"
The top in the frame refers to the top-level framework in the framework center
Close the current window:();
The box to indicate whether to confirm: if(confirm("Are you sure?")){alert("ok");}else{alert("Not Ok");}
window redirection:("";);
Print in: ()
The prompt input box in: ("message","defaultReply");
Window scrollbar in:(x,y)
The window in the scroll to position:
Set the time interval in: setInterval("expr",msecDelay) or setInterval(funcRef,msecDelay) or setTimeout
The modal in the IE4+ line is displayed, but not in NN: showModalDialog("URL"[,arguments][,features]);
The handle used before exit in: function verifyClose(){="we really like you and hope you will stay longer.";}}   =verifyClose;
86. File handle used when the form is called for the first time: onload()
87. File handle called when the form is closed: onunload()
Protocol(http:),hostname(),port(80),host(:80),pathname("/a/"), hash("#giantGizmo", refers to jumping to the corresponding anchor),href(all information)
()Refresh the current page.
() Return to the previous page, () Return to the next page, (return to the page, you can also use the visited URL)
() Output without line breaks, () Output without line breaks
=true; prevents link text from breaking.
93. Variable name.charAt (that bit), take the character of the variable in which bit bit.
94. "abc".charCodeAt (this number), returns the ASCii code value of the number of characters.
95. String connection: (string2), or use += to connect
96. Variable.indexOf("character", start position), return the first occurrence position (calculated from 0)
(searchString[,startIndex]) where the last occurrence is.
(regExpression), determines whether the characters match.
(regEx expression,replace String) Replace existing string.
(delimiter) returns an array to store the value.
(start[,length]) Takes the string from the specified length from which bit.
() Make all strings small.
() Make all characters uppercase.
(string[,radix(represents binary)]) cast into integer.
(string[,radix]) cast to floating point type.
(Variable): Test whether it is numerical.
107. Define the keywords for constants: const, define the keywords for variables: var
Previous page12Read the full text