A common method of writing in jquery

Source: Internet
Author: User

$ ('form'//  form submission
Window.parent.location.reload ();    // child window refreshes parent page
Window.location.reload ();   // Refresh the current page
$ ('input'). blur (function () {...})   // event occurs when the mouse moves out of the input box
$ ('. Addwork'). Live ('click', function () {        $ ( ' #hrcboxClose '). CSS ('visibility','hidden');   // want to hide the small x in the pop-up window, use Display:none, when invalid, you can try Visibility:hidden    });
    //use TP5 as the framework to select an option to replace the entire page or a local page, you can pass the selected parameters in the past, and then return in the controller $this->fetch () a page, the entire page through the method of the string return (Ajax does not specify the type of data returned, the default is a string), in order to replace the place you want to replace, such as the entire body. $(' Select'). Change (function () {varSubjecttitle = $ ('. Subject_title'). Val (); Get selection criteria $.post ("Filter",//The method requested {subjecttitle:subjecttitle//Pass the condition past},            function (data) {Console.log (data); Returns the same page as a string, in the form of $ ('Body'). HTML (data); Replace the body of the current page with a new page)})
 //TP5 If you replace the original page with a new page in the page will appear after the click Page to jump to the URL corresponding to the page number, the solution is as follows:$('. Pagination'). Find ('a'). each (function () {//iterate through each page number in a page$( This). Click (function () {//If a page number is clicked            varURL = $ ( This). attr ('href');//gets the href attribute of itparam = url.substring (Url.indexof ("?") +1). Split ("&");//get page parameters, such as [page=2]            varpage = param[0].substring (param[0].indexof ("=") +1). Split ("=")[0];//get the value of the page number, for example: 2$('. Pagination'). Find ('a'). attr ('href','javascript::void (0)');//change the href attribute of the page number to javascript:void (0) and not jump to the URL of the page number            varSubjecttitle = $ ('. Subject_title'). Val ();//passing the parameters of select$.post ("Filter", {subjecttitle:subjecttitle,//pass the selection criteria and page numbers pastPage:page}, function (data) {$ ('Body'). HTML (data);//re-replace body                }            )        })    })

A common method of writing in jquery

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.