python Test Development (distal 06- [HTML, JS, CSS] + ajax request)

1.HTML

slightly

2.JS

I = 0 var; 
the while (I <10) {
the console.log (I);
I ++;
}

for (var J = 0; J <10; J ++) {
the console.log (J)
}

// for in: through the loop
// iterate
var = the array of aList (11,22,33,44,55);
for (I in of aList) {
the console.log (I); // traverse the array index
console.log (aList [i]) // iterate value
}

// traverse the object: out of the traversal attribute
var obj = {
name: 'Yuan',
Age: 18 is,
Gender: 'MALE'
}
for (in I obj) {
the console.log (I) ;
the console.log (obj [I])

}

3.CSS

slightly

4.ajax which two request methods:


$ (function () {
// Ajax request
$ ( '# DL') the Click (function () {.
// Get Account
var User = $ ( '# username') Val ();.

// get the password
var pwd = . $ ( '# password') Val ();

// --- correlation encrypted> is not the first treatment, to be decrypted back

// send ajax request
// // a manner:
// $ .ajax ({
// / / ajax three important properties: URL, type, Success
// URL: '/ Login /',
// Data: { "User": User, "pwd": pwd},
// type: 'the POST',
// // data type request
@ dataType: 'JSON',
// // request succeeds will return success as a parameter to the data
// success:function (Data) {
// // Analyzing Data with wood have been returned
IF // (data.code == '. 1') {
// Alert (data.msg)
// the else {}
// // pop commit fails elastic frame
// // Alert (data.msg)
// / / ajax request type
// $ (the this) .text () the append (data.msg);.
//}
//
//}
})
// Second way: done and are now used more fail
$ .ajax ( {
// Ajax three important properties: URL, type, Success
URL: '/ Login /',
data: { "User": User, "pwd": pwd},
type: 'the POST',
// request data type
dataType : 'JSON',

}).done(function (data) {
IF (data.code == '. 1') {
Alert (data.msg)
} the else {
// pop commit fails elastic block
// Alert (data.msg)
// Ajax request type
$ (this) .text ( ) .append (data.msg);
}
.}) fail (function (Data) {
Alert () "request failed!"
})

})

Guess you like

Origin www.cnblogs.com/vivian0119/p/12038315.html