0

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.

Steven Matthews
  • 9,705
  • 45
  • 126
  • 232

1 Answers1

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>
pylover
  • 7,670
  • 8
  • 51
  • 73
Gabe
  • 49,577
  • 28
  • 142
  • 181