Reputation: 11285
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.
Upvotes: 0
Views: 1444
Reputation: 50493
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>
Upvotes: 3