jquery with the Tang notes

Source: Internet
Author: User

First, popup box
A. Prompt box
alert ();
B. Input box
Prompt ();
C. Confirmation Box
Confirm ();
var flag= confirm ("Confirm delete?" ");
Second, JS program debugging
Check console console for errors first
Browser Debug
alert ();
Console.log ();
Third, function
System functions:
parseint (); A string that converts the first character to a number
Number (); A string that converts only numbers
IsNaN (); Is isn't a number///Is it a non-numeric?
Custom functions:
A, funtion method name (parameter 1, parameter 2 ...) {
Return
}
Funtion Show (str,age) {}
public void Show (String str,int age) {

}
B. Var method name =function (parameter 1, parameter 2 ...) {
return value
}
Invoking the JS code in a hyperlink
<a href= "JAVASCRIPT:SF (); > Please click </a>
Iv. events commonly used in JS
OnLoad//Page load complete execution
OnClick//Mouse click event
onmouseover//Mouse over events
onmouseout//Mouse Move Event
onfocus//Focus Input Box Event
onblur//Remove input box events
OnKeyDown Keyboard press Event
Carriage return Event:
Document.onkeydown=function (e) {
if (e.keycode==13) {//Enter
Alert ("Login! ");
}
}
onchange;//drop-down box toggle Event
<select onchange= "alert (' dropdown box changed ');" >
<option> Beijing </option>
<option> Shenzhen </option>
<option> Hefei </option>
</select>
onsubmit;//Form Submission Events
V. Browser object Model
Window object (general ellipsis not written)
Window.onload = function () {
}
Common Properties
History
Window.history.go (-1);//Return to previous page
History.go (0);//Refresh
Window.history.go (1);//Next page
Location
Location.reload ();//Refresh
Jump page:
Window.location.href = "http://www.bdqn.cn";
Common methods:
Alert ();p rompt (); Confirm ();
Opens a new window open ();
Close: Close ();

jquery with the Tang notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.