Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml http request question

Status
Not open for further replies.

dpark27

Programmer
Jan 23, 2008
6
US
Hello I had a question and hoping somebody could clarify. When you make a page request using an XMLHttpRequest object, does it refresh and reflect changes in the page every couple minutes like a browser?
 
Browsers don't refresh and reflect changes unless something tells them to (either a script, meta-refresh tag or the user).

To answer your question, no - the XMLHttpRequest object does not periodically refresh itself with the latest version of whatever URL it last pointed at. Any such behaviour would be an absolute nightmare to work with since you would never know if or when your code might be half-way though processing the results of some operation and the object would go and change the data stored in it's response.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Webflo
 
Maybe he means if it cache the page request like the browser do. I don't know. But it's wise to use a timestamp in the URL when making HTTP Requests to be sure that the Request is fresh..

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top