refreshing data in http request header
I am writing a web page for the EvE online game using php and javascript. The EvE in-game browser sets some proprietary headers which include information about a characters location etc.
The web page is meant to draw a map showing the location of everyone connected to the web page. In order to track peoples movements the location information within the header needs to periodically update.
My current solution is to add a hidden iframe with a simple page refresh. This works, but the reloading of the iframe is visible on the status bar (it shows the url of the page being loaded). Ive seen other location tracking webpage开发者_开发知识库s that didnt show a url being loaded on the status bar and Im wondering if theres a more elegant solution to getting a fresh http request
Thanks for the advice guys. Im not too familiar with javascript or php so muddled my way through all the advice and finally used
setInterval(function() {
GetUpdate();
}, 5000
);
function GetUpdate()
{
var xhReq = new XMLHttpRequest();
xhReq.open("POST", "http://myurl/parser.php", false);
xhReq.send(null);
}
This seemed to do the trick without me confusing myself too much
perhaps you can use Ajax?
JQuery-PeriodicalUpdater
jQuery and AJAX response header
精彩评论