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,141
  • 40
  • 114
  • 203

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,075
  • 8
  • 45
  • 72
Gabe
  • 48,376
  • 28
  • 140
  • 179