$ ('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