How to organize logically?
1. JS Timer refresh function setinterval (function,time) is required.
2. Only the local labels in the Web page need to be refreshed
function is a custom function, time is how long to execute a custom function, in milliseconds
3. You can make a local refresh by defining a custom function, you need to import jquery
Code demo, how?
SetInterval (function() { $ ("#history"). Load (location.href+ "#history >*", ""); 2000);
Define a timer, refresh once in 2 seconds, customize function functions each time the refresh executes all content id=history in the Id=history refresh load on the specified Web page
Location.href says refresh this page
Load means loading a webpage, selectively adding some elements to the Web page, load (Url,[data],[callback])
ULR represents the URL #some > selector, is a string, the URL and # have spaces in the middle, specifies that the loaded Url,id=some label,> represents the load, * denotes all, + represents string concatenation
[] represents optional, data data is Key/value form, callback represents callback function, function executed after loading is completed
What are the application scenarios?
In situations where real-time requirements are high, such as stock trading, airline ticket booking, etc.
How to make a local refresh of the page?