Original javaScript factory MethodBecause the attributes of an object can be dynamically defined after the object is created, the following code will be written at the beginning of JavaScript introduction.
Copy codeThe Code is as follows:Var oCar =
Method 1,Copy codeThe Code is as follows:Function CheckForm (){If (document. form1.trainingName. value = ""){Alert ("the training class name cannot be blank! ");Document. form1.trainingName. focus ();Return false;}}Method 2: jqueryCopy codeThe Code
1) disable the right-click FunctionIf you want to protect your website information, you can use this code to disable the right-click function.Copy codeThe Code is as follows:$ (Document). ready (function (){// Catch the right-click context menu$
What is ActiveX Control?
ActiveX controls are widely used in the Internet. They can increase browsing pleasure by providing videos and animated content. However, these programs may have problems or provide you with unwanted content. In some cases,
Copy codeThe Code is as follows:ContentType = "text/html; charset = UTF-8" %> WebForm5 Root nav item1 Sub nav item1 Sub nav item1-2 Root nav item2 Sub nav item2 Sub nav item2-2 Root nav item3 Sub nav item3 Sub nav item3-2
When ajax is used to obtain data, data. foo can be obtained directly. The earlier versions of jquery won't work, for example, before 1.4.Copy codeThe Code is as follows:$. Post ('/admin/UserBookView. do', {}, function (data ){Console.info (data );});
When working on a front-end project in the past two days, you can use jquery to traverse the checkbox on the page and use the following code:Copy codeThe Code is as follows:Var val_instanceCodeStr = "";
$ ("Input [type = 'checkbox'] [name = 'chk _
In the afternoon, a friend asked me how to paging the json data.
The following code is used:Copy codeThe Code is as follows: untitled document
category1_id category1_name category1_intro category1_images
next page previous page
Drop-down box:
// Get the text of the selected item in the drop-down menu (note that there is a space in the middle)Var C0 = $ (". formc select [@ name = 'country'] option [@ selected]"). text ();// Obtain the value of the selected item from the
In general, it is done by hovering the mouse over onmouseover and removing the onmouseout.
First, the HTML Structure
Copy codeThe Code is as follows: sidebar
Then the css style:
Copy codeThe Code is as follows:# Div1 {Width: 150px;Height:
If else is used to implement (add_step change) under different conditions, the add_level result value is different:Copy codeThe Code is as follows:Var add_level = 0;If (add_step = 5 ){Add_level = 1;}Else if (add_step = 10 ){Add_level = 2;}Else if
When transmitting parameters, we often encounter parameters with the same attributes transmitted to the backend. The best choice is to use arrays. When we send data to the background, we only need to define and use arrays in javascript, and pass
I used an onclick event to highlight the selected rows in order to make the search results better:Copy codeThe Code is as follows:Var assno = "";Function check (obj, che, rwid ){If (obj. checked = true ){Document. getElementById (rwid). style.
Window. onload = function () {alert ("welcome ");}This method is used to automatically execute the js Code (function) after loading the page ).
$ (Document). ready (function () {...}) is used to replace window. onload;
Document. ready () is similar
Request data
We can use GET or POST to request data from the backend. Here, we use PHP as an example. Assume that the test page age. php is used to return the age information. The content is:
if(isset($_REQUEST['name']) && $_REQUEST['name'] ==
Real applications need to interact with real servers. mobile applications and emerging Chrome desktop applications may be an exception, but for all other applications, whether you want to persist data to the cloud or interact with other users in
Today, I'm a little happy. The number of csdn blog views has exceeded. I have never seen such a high number of views in the past. I have to say that there are still some bad feelings when there are too many times. I can see that these encouragement
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