Forum Moderators: open
I implemened a javascript on a news wesbite, so the page refreshes each time someone visits the site instead of serving up from their cache.
But this seems to have made the page unusable on safari.
Any Ideas?
Here's the code:
<SCRIPT LANGUAGE="JavaScript"><!--
function y2k(number) { return (number < 1000)? number + 1900 : number; }
var now = new Date();
var nowsecs = Date.UTC(y2k(now.getYear()),now.getMonth(),now.getDate(),now.getHours(),now.getMinutes(),now.getSeconds());
if (location.search) {
var thensecs = location.search.substring(1);
var difference = nowsecs - thensecs;
if ((nowsecs - thensecs) > 10000) {
location.replace(location.href.substring(0,location.href.length - location.search.length) + '?' + nowsecs)
}
}
else {
location.replace(location.href + '?' + nowsecs);
}
//--></SCRIPT>
Here are some user complains:
Safari Omniweb 4.4: Continous restarts, 3-4 after every article
Safari 2.0.1 Mac OSX : Browser will not load home page
Safari 1.2.3 Mac Panther 10.3:Page keeps Re-loading over and over.
Date.UTC(now.getUTCFullYear(),now.getUTCMonth(),now.getUTCDate(),now.getUTCHours(),now.getUTCMinutes(),now.getUTCSeconds())
Additionally, you may wish to consider running Linux, as that way you can test on Konqueror, Safari's less sinister twin. I would recommend a Debian-based distro, such as Xandros or Ubuntu. Xandros will painlessly install beside Windows and allow you a quality operating system experience. Quanta Plus is an excellent web editor, working well with (X)HTML, JavaScript, and PHP.