Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of Local and Global Refresh of ajax

Shulou Source: shulou.com Published: 2022-06-03 11:47:58 11月15日 Update

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)

Tags: Local parameter whole example analysis three content function address attribute skill scheme method knowledge page encapsulation concise concise two lieutenant general Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Microsoft Redmi Shulou Information Linux