Results 1 to 2 of 2

Thread: Javascript Function Not Working

  1. #1
    Join Date
    Apr 2005

    Javascript Function Not Working

    I was told this is how to switch web pages using Javascript:

    location.href = "pagename.htm";

    It works fine when I use the IE and Opera browsers. In Firefox, on the other hand, it keeps popping back to the original page.

    P.S. I need this question answered within 24 hours, because I have to hand in an assignment tomorrow. Right now that malfunction is all that's preventing my program from working. I haven't got much time... and I've been struggling with this problem for at least a week...

  2. #2
    Join Date
    Nov 2002
    Dartmoor [Holiday]
    For a start, it would help if you posted in the correct forum. (Mods, can you move this please?)

    I'm guessing you are calling this code via the onclick event handler of a hyperlink, or something similar, in which case try adding return false; after the code you have. Otherwise, you will need to show us more code because what you have there is correct.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles