So I have an image which displays on every page, however I'd like to write a script that will, depending on the page, replace the image with another image. How would I programmatically determine what page I am on? The actual image replacement I can already do.
Asked
Active
Viewed 1,418 times
0
-
Why the -1? I figure it's an acceptable question. – Steven Matthews Apr 13 '12 at 22:52
-
possible duplicate of [Request Address in Javascript](http://stackoverflow.com/questions/1029387/request-address-in-javascript) – Dagg Nabbit Apr 13 '12 at 23:01
-
I downvoted because the question shows no original research effort (per tooltip on downvote arrow). And two others downvoted for some reason. Mystery 1/3 solved. – Dagg Nabbit Apr 13 '12 at 23:38
-
Alright, in the future I'll make sure to show a better effort of the research I've done prior to asking the question. – Steven Matthews Apr 13 '12 at 23:59
1 Answers
3
You could use location
<script type="text/javascript">
alert(window.location);
// and you can set the location to move to another page
window.location = "http://stackoverflow.com"
</script>
-
Was intending on it, just had to wait for the time period to expire. – Steven Matthews Apr 13 '12 at 23:59