python whole stack development _day47_js, jQuery

JS: Javascript
with nothing to do with Java, Java is the original fire, which is to rub the door Java heat, so named Javascript


Notes:
// single line comment
/ *
multiline comment
* /

Entry Mode
Mode 1: directly in the script internal write js code
embodiment 2: using the src attribute of the script tag is introduced into an external js code files

declare variables:
var name = 'Hello'
the let name = 'Hello'

js variable naming:
alphanumerical underscores $
numbers can not start and can not be present keyword conflicts

python are recommended: USER_NAME
Javascript recommended (hump body): the userName, UserName

Js data type
value type

string type
Boolean
undefined
objects
null
array [1,2,3,4]
customized object { "name" : "Jason"}
Symbol

the JSON objects
the stringify
the parse



js defined two ways of regular
REG1 = new new the RegExp ( '^ [A-Za-Z] [A-Za-Z0-9] {5,9} $')
REG2 = / ^ [A-Za-Z] [a-Za-z0-9] { 5,9} $ /

pit highlights:
1. regular expressions do not write spaces
2. global mode lastindex match
when matching 3 does not pass any parameters to match the default undefined

BOM
Object Model broswer
the DOM (******)
the Document Object Model
direct lookup (******)
the above mentioned id
class (class)
tag (label)


indirect Find

Guess you like

Origin www.cnblogs.com/xuxingping/p/10971439.html