www.webdeveloper.com
Results 1 to 2 of 2

Thread: Replacing the current page

  1. #1
    Join Date
    Apr 2009
    Posts
    1

    Replacing the current page

    Hi all,

    I'm creating a Javascript based quiz which shows the user a picture and then has a question underneath with a text box where they need to type their answer.

    I have a function which tests their answer with an IF statement and then if it is correct loads a new page (containing the next question) into the current window, replacing what is there.

    How might I go about this?

    I've tried;

    window.location.replace('question2.html');

    but it just keeps the same page?

    The files need to be based locally on my c: drive as this is what the spec has said.

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    window.location='question2.html';
    At least 98% of internet users' DNA is identical to that of chimpanzees

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