Forum Moderators: open
putting a normal redirect in does work insofar as the page will redirect, but my statscript doesn't appear to be activated first. Does putting the redirect in cause the code which comes first to be ignored?
<HTML>
<body stats=1>
<script language="javascript">
<!-- code for my StatScript here -->
window.location='http://pub.exeter.gov.uk/asp/eahod/';
</script>
</BODY>
</HTML>
<script language="javascript">
setTimeout('location.href="http://example.com"',2000);
</script>
Or use location.replace, window.location=url, etc.
EDIT: note the url is double quoted inside single quotes:
setTimeout(' location.href= "url" ',5000);
Just had a reply from my stats provider who recommended the exact same thing. Great minds and all that... :)
I guess I'll have to go with this. I'm a little concerned about doing this kind of stuff with js and delays etc. it doesn't seem like the cleanest way of doing stuff, but it seems the only way to track things with my stats package.
Cheers,
Helen.
<meta http-equiv="refresh" content="2; url=http://www.example.com">
Would redirect after two seconds.
Don't you have some way of registering that your stats script is being triggered? Not knowing what it's doing, it seems like you could send some unique variable or marker from this page, then go check the data and see if it picked it up. As I already guessed, it may be working fine just too quickly to see it.
Don't you have some way of registering that your stats script is being triggered?
only that the page shows up in the stats report, or doesn't.
Is the stats script submitting a form?
I'm not sure exactly what the stats script does, but I understand that it tracks an image, and it uses cookies. I don't think forms are involved.
Cheers for your feedback anyway guys :) as it appears to be working OK at the moment, so I'm gonna leave well enough alone, even with the js delayed redirects.
The site is going live in a few days and I don't want to break it!