Home > Web Front-end > JS Tutorial > body text

JavaScript cross-domain refresh implementation code_javascript skills

WBOY
Release: 2016-05-16 18:12:37
Original
1308 people have browsed it

Three pages are in the same window, namely main.htm, left.htm and right.htm.
main.htm

Copy code The code is as follows:



Achieve cross-
>





left.htm


left

I am on the left





right.htm


right








See inside right.htm
function onclickRefresh() is implemented through parent.frames["left"].location.refresh(); The right page refreshes the left page.
If you add



to the main page, copy the code and the code is as follows:



You can access it through the home page Refresh the subpage.
Although this can be super simple to achieve the purpose, in actual projects, the data will not be so simple. The most common is the left and right trees. The creation and loading of the directory tree (such as creating a thousand nodes) is inherently more resource intensive. . If we still use the method to refresh the left and right pages, the efficiency is obviously low, then is it possible to achieve cross-domain refresh or submission through other methods?
What I am thinking of is partial loading of data through ajax. Instead of loading the entire tree. In addition, local data can also be updated through jquery's json processing method.
I wonder if there is any other more efficient method? When loading a tree of 1,000 nodes, the efficiency is worth thinking about.
Related labels:
source:php.cn
Previous article:JQuery binds the onchange event of the select tag, pops up the selected value, and implements jumps and parameter passing_jquery Next article:Explanation of the difference between Sub and Function in ASP_javascript skills
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template