Example Analysis of Local and Global Refresh of ajax
This article shows you ajax partial and overall refresh example analysis, the content is concise and easy to understand, absolutely can make your eyes bright, through the detailed introduction of this article, I hope you can get something.
First of all, let me talk about the plan.
$p.load (url,data,function (response,status,xhr))
Then we need to provide at least two parameters to the callback function of the ajax request, url and a jquery object.
In addition, we may have the possibility of overloading the address bar.
Location.href
So, we need to provide one more parameter.
Therefore, we encapsulate three attributes
/ / partial load String elementId = getPara ("elementId"); String loadPage = getPara ("loadPage"); / / address bar jump path String locationUrl = getPara ("locationUrl"); setAttr ("elementId", elementId); setAttr ("loadPage", loadPage); setAttr ("locationUrl", locationUrl)