Ikariam kChen Overview

By kchen Last update Feb 18, 2009 — Installed 346,353 times.

Auto Refresh problem

in
Subscribe to Auto Refresh problem 3 posts, 2 voices



hanoveel User

The auto refresh code in the script does not work right, It write a lot of text that is not a valid address (this is what strurl equals "data:text/html,%3Cbody%20onload%3D%22document.forms%5B0%5D.submit()%22%3E%0A%20%20%3Cform%20method%3D%22POST%22%20action%3D%22http%3A%2F%2Fs1.ae.ikariam.com%2Findex.php%22%3E%0A%20%20%20%20%3Cinput%20type%3D%22hidden%22%20name%3D%22action%22%20value%3D%22header%22%2F%3E%0A%20%20%20%20%3Cinput%20type%3D%22hidden%22%20name%3D%22function%22%20value%3D%22changeCurrentCity%22%2F%3E%0A%20%20%20%20%3Cinput%20type%3D%22hidden%22%20name%3D%22oldView%22%20value%3D%22city%22%2F%3E%0A%20%20%20%20%3Cinput%20type%3D%22hidden%22%20name%3D%22view%22%20value%3D%22city%22%2F%3E%0A%20%20%20%20%3Cinput%20type%3D%22hidden%22%20name%3D%22cityId%22%20value%3D%22156372%22%2F%3E%0A%20%20%20%20%3Cinput%20type%3D%22hidden%22%20name%3D%22actionRequest%22%20value%3D%22d0a7d8bbe6beeeea94f40220a3fd1c62%22%2F%3E%0A%20%20%3C%2Fform%3E%0A%3C%2Fbody%3E")

the script code:

if (AUTO_REFRESH) {
	var cities = $x("//select[@id='citySelect']/option", $("citySelect"));
	var idx = $("citySelect").selectedIndex+1;
	idx %= cities.length;
	var city_id = $x("//select[@id='citySelect']/option", $("citySelect"))[idx].value;
	var strurl = postUrl("?action=header&function=changeCurrentCity&oldView=city&view=city&cityId="+ city_id);
	var timeID = setTimeout("location.href= '"+strurl+"'", getRefreshTime());
}

It edited and it worked fine for me (I am on ae server)

if (AUTO_REFRESH) {
	var strurl = window.location;
	var timeID = setTimeout("location.href= '"+strurl+"'", getRefreshTime());
}

 
lexichlong(LxL) User

Or you can edited the code like this maybe it will work.

if (AUTO_REFRESH) {
var timeID = setTimeout(window.location.reload()
, getRefreshTime());
}

 
hanoveel User

The code you posted when I apply it it refresh always without stoping

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel