1.document.write(""); Output statement
2. The comment in JS is //
3. The traditional order of HTML documents is: document->html->(head,body)
4. The DOM sequence in a browser window is: window->(navigator, screen, history, location, document)
5. Get the name and value of the element in the form: document.getElementById("ID number of the element in the form").name (or value)
6. A JS that converts lowercase to uppercase: document.getElementById("output").value = document.getElementById("input").value.toUpperCase();
7. Value types in JS: String, Number, Boolean, Null, Object, Function
8. Convert character type to numeric type in JS: parseInt(), parseFloat()
9. Convert numbers in JS to character type: ("" variable)
10. The length of string in JS is: (length)
11.Characters in JS are connected with characters using numbers.
12. The comparison operators in JS are: == equal to, != not equal to, >, >=, <.>
13. Use: var to declare variables in JS
14. Judgment statement structure in JS: if(condition){}else{}
15. Loop structure in JS: for([initial expression];[condition];[upadte expression]) {inside loop}
16. The command to terminate the loop is: break
17. Function definition in JS: function functionName([parameter],...){statement[s]}
18. When multiple forms appear in the file, you can use document.forms[0], document.forms[1] instead.
19. Window: open window window.open(), close a window: window.close(), window itself: self
20. Status bar settings: window.status="character";
21. Pop-up prompt message: window.alert("Character");
22. Pop up confirmation box: window.confirm();
23. Pop up the input prompt box: window.prompt();
24. Specify the location of the currently displayed link: window.location.href="URL"
25. Get the number of all forms in the form: document.forms.length
26. Close the document’s output stream: document.close();
27. String append concatenation: =
28. Create a document element: document.createElement(), document.createTextNode()
29. Method to get elements: document.getElementById()
30. Set the value of all text members in the form to be empty:
var form = window.document.forms[0]
for (var i = 0; i
if (form.elements[i].type == "text"){
form.elements[i].value = "";
}
}
31. Determine whether the check button is checked in JS: document.forms[0].checkThis.checked (the checked attribute represents whether it is selected and returns TRUE or FALSE)
32. Radio button group (the names of the radio buttons must be the same): take the length of the radio button group document.forms[0].groupName.length
33. The radio button group also uses checked to determine whether it is selected.
34. The value of the drop-down list box: document.forms[0].selectName.options[n].value (n sometimes uses the name of the drop-down list box plus .selectedIndex to determine the selected value)
35. Definition of string: var myString = new String("This is lightsword");
36. Convert a string to uppercase: string.toUpperCase(); Convert a string to lowercase: string.toLowerCase();
37. Return the position where string 2 appears in string 1: String1.indexOf("String2")!=-1 means it was not found.
38. Get a character at the specified position in the string: StringA.charAt(9);
39. Take out the substring with specified starting point and end point in the string: stringA.substring(2,6);
40. Mathematical functions: Math.PI (returns pi), Math.SQRT2 (returns square root), Math.max(value1, value2) returns the greatest value of two numbers, Math.pow(value1,10 ) returns the tenth power of value1, Math.round(value1) rounding function, Math.floor(Math.random()*(n 1)) returns a random number
41. Define date variables: var today = new Date();
42. List of date functions: dateObj.getTime() gets the time, dateObj.getYear() gets the year, dateObj.getFullYear() gets the four-digit year, dateObj.getMonth() gets the month, dateObj.getDate() gets
Day, dateObj.getDay() gets the date, dateObj.getHours() gets the hours, dateObj.getMinutes() gets the minutes, dateObj.getSeconds() gets the seconds, dateObj.setTime(value) sets the time, dateObj.setYear (val) sets the year, dateObj.setMonth(val) sets the month, dateObj.setDate(val) sets the day, dateObj.setDay(val) sets the day of the week, dateObj.setHours sets the hours, dateObj.setMinutes(val) sets the minutes, dateObj .setSeconds(val) sets seconds [Note: This date and time starts from 0]
43.FRAME representation: [window.]frames[n].ObjFuncVarName,frames["frameName"].ObjFuncVarName,frameName.ObjFuncVarName
44.parent represents the parent object, and 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 a JS function in a hyperlink, use: (javascript:) to start with the function name
48. Do not execute this JS in old browsers:
49. Quote a file-style JS:
50. Specify HTML to be displayed in browsers that do not support scripts:
51. When there are both hyperlinks and ONCLICK events, the old version of the browser will redirect to a.html, otherwise it will redirect to b.html. Example: dfsadf
52. The built-in objects of JS are: Array, Boolean, Date, Error, EvalError, Function, Math, Number, Object, RangeError, ReferenceError, RegExp, String, SyntaxError, TypeError, URIError
53. Line breaks in JS:n
54. Window full screen size:<script>function fullScreen(){ this.moveTo(0,0);this.outerWidth=screen.availWidth;this.outerHeight=screen.availHeight;}</script>
window.maximize=fullScreen;
55.all in JS represents all the elements below it
56.Focus order in JS: document.getElementByid("Form Element").tabIndex = 1
57. The value of innerHTML is the value of the form element: such as
"how are you"
, then the value of innerHTML is: how are you58.The value of innerTEXT is the same as above, except that tags like will not be displayed.
59.contentEditable can set whether the element can be modified, and isContentEditable returns whether the element can be modified.
60.isDisabled determines whether it is a prohibited state. disabled sets the prohibited state
61.length gets the length and returns an integer value
62.addBehavior() is an external function file called by JS. Its extension is .htc
63.window.focus() puts the current window in front of all windows.
64.blur() means losing focus. It is the opposite of FOCUS().
65.select() means that the element is selected.
66. Prevent users from entering text into the text box:
67. Get the number of occurrences of this element on the page: document.all.tags("div (or other HTML tags)").length
68.JS is divided into two types of form output: modal and non-modal.window.showModaldialog(), window.showModeless()
69. Status bar text setting: window.status='text', default status bar text setting: window.defaultStatus = 'text.';
70. Add to favorites: external.AddFavorite("http://www.xrss.cn","jaskdlf");
71. No action is taken when a script error is encountered in JS: window.onerror = doNothing; The syntax for specifying an error handle is: window.onerror = handleError;
72. Specify the parent window of the currently opened window in JS: window.opener, and support multiple continuations of opener.opener...
73.Self in JS refers to the current window
74. The content displayed in the status bar in JS: window.status="content"
75. The top in JS refers to the topmost frame in the frame set
76. Close the current window in JS: window.close();
77. Confirmation box in JS: if(confirm("Are you sure?")){alert("ok");}else{alert("Not Ok");}
78.Window redirection in JS: window.navigate("http://www.sina.com.cn");
79. Printing in JS: window.print()
Prompt input box in 80.JS: window.prompt("message","defaultReply");
Window scroll bar in 81.JS: window.scroll(x,y)
82.Scroll the window to the position in JS: window.scrollby
83. Set time interval in JS: setInterval("expr",msecDelay) or setInterval(funcRef,msecDelay) or setTimeout
84. The modal display in IE4 in JS does not work in NN: showModalDialog("URL"[,arguments][,features]);
85. The handle used before exiting in JS: function verifyClose(){event.returnValue="we really like you and hope you will stay longer.";}} window.onbeforeunload=verifyClose;
86. The file handle used when the form is called for the first time: onload()
87. File handle called when the form is closed: onunload()
Attributes of 88.window.location: protocol(http:),hostname(www.example.com),port(80),host(www.example.com:80),pathname("/a /a.html"), hash("#giantGizmo", refers to jumping to the corresponding anchor), href (all information)
89.window.location.reload() refreshes the current page.
89-1.parent.location.reload() refreshes the parent object (for frames)
89-2.opener.location.reload() refreshes the parent window object (for single-open window)
89-3.top.location.reload() refreshes the top object (for multiple windows)
90.window.history.back() returns to the previous page, window.history.forward() returns to the next page, window.history.go (return to which page, you can also use the visited URL)
91.document.write() output without line breaks, document.writeln() output with line breaks
92.document.body.noWrap=true; prevent link text from wrapping.
93. Variable name.charAt(number), get the character of the variable.
94."abc".charCodeAt(number), returns the ASCii code value of which character.
95. String concatenation: string.concat(string2), or use = to connect
96. Variable.indexOf("Character", starting position), returns the first appearing position (calculated from 0)
97.string.lastIndexOf(searchString[,startIndex]) The last occurrence position.
98.string.match(regExpression), determine whether the characters match.
99.string.replace(regExpression,replaceString) replaces the existing string.
100.string.split (separator) returns an array to store the value.
101.string.substr(start[,length]) takes the string from the digit to the specified length.
102.string.toLowerCase() makes the string all lowercase.
103.string.toUpperCase() makes all characters uppercase.
104.parseInt(string[,radix(representing base)]) is forced to convert to integer type.
105.parseFloat(string[,radix]) is forced to convert to floating point type.
106.isNaN (variable): Test whether it is a numeric type.
107. Keywords for defining constants: const, keywords for defining variables: var
In the end, I still didn’t get the one hundred and eight generals. I’m just a little sorry. Is it okay if my friends can help make up?

如何使用JS和百度地图实现地图平移功能百度地图是一款广泛使用的地图服务平台,在Web开发中经常用于展示地理信息、定位等功能。本文将介绍如何使用JS和百度地图API实现地图平移功能,并提供具体的代码示例。一、准备工作使用百度地图API前,首先需要在百度地图开放平台(http://lbsyun.baidu.com/)上申请一个开发者账号,并创建一个应用。创建完成

js字符串转数组的方法:1、使用“split()”方法,可以根据指定的分隔符将字符串分割成数组元素;2、使用“Array.from()”方法,可以将可迭代对象或类数组对象转换成真正的数组;3、使用for循环遍历,将每个字符依次添加到数组中;4、使用“Array.split()”方法,通过调用“Array.prototype.forEach()”将一个字符串拆分成数组的快捷方式。

如何使用JS和百度地图实现地图热力图功能简介:随着互联网和移动设备的迅速发展,地图成为了一种普遍的应用场景。而热力图作为一种可视化的展示方式,能够帮助我们更直观地了解数据的分布情况。本文将介绍如何使用JS和百度地图API来实现地图热力图的功能,并提供具体的代码示例。准备工作:在开始之前,你需要准备以下事项:一个百度开发者账号,并创建一个应用,获取到相应的AP

如何使用JS和百度地图实现地图多边形绘制功能在现代网页开发中,地图应用已经成为常见的功能之一。而地图上绘制多边形,可以帮助我们将特定区域进行标记,方便用户进行查看和分析。本文将介绍如何使用JS和百度地图API实现地图多边形绘制功能,并提供具体的代码示例。首先,我们需要引入百度地图API。可以利用以下代码在HTML文件中导入百度地图API的JavaScript

js中new操作符做了:1、创建一个空对象,这个新对象将成为函数的实例;2、将新对象的原型链接到构造函数的原型对象,这样新对象就可以访问构造函数原型对象中定义的属性和方法;3、将构造函数的作用域赋给新对象,这样新对象就可以通过this关键字来引用构造函数中的属性和方法;4、执行构造函数中的代码,构造函数中的代码将用于初始化新对象的属性和方法;5、如果构造函数中没有返回等等。

这篇文章主要为大家详细介绍了js实现打字小游戏,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下。

php在特定情况下可以读js内部的数组。其方法是:1、在JavaScript中,创建一个包含需要传递给PHP的数组的变量;2、使用Ajax技术将该数组发送给PHP脚本。可以使用原生的JavaScript代码或者使用基于Ajax的JavaScript库如jQuery等;3、在PHP脚本中,接收传递过来的数组数据,并进行相应的处理即可。

js全称JavaScript,是一种具有函数优先的轻量级,直译式、解释型或即时编译型的高级编程语言,是一种属于网络的高级脚本语言;JavaScript基于原型编程、多范式的动态脚本语言,并且支持面向对象、命令式和声明式,如函数式编程。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor
