Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Creating this?

  1. #1
    Have1abanana
    Guest

    Creating this?

    Hi everyone!
    I saw this site with this on and I was wondering how I could do the same thing, with my own quizzes, ie, how to gather the input and make it go to the specified link, etc.
    I cant really explain it so here's the link:

    http://www.relentlessdivas.net/disneyquiz.html

    And basically, how?!

    What's the process for making one of these?

    I really appreciate the help




    Thanks!

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you view the source on that page it's pretty much all there.

    They define 4 variables (snowwhite, ariel, cinderella, belle) and increment these each by one for each answer that pertains to that subject. Then the variable with the highest number(score) is used to redirect the user to the appropriate HTML page.

  • #3
    Have1abanana
    Guest
    Thanks!

    I'm probably being dense again, but how do you direct to the appropriate page?

  • #4
    New Coder
    Join Date
    Jun 2002
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if something equals something, window.location.replace('urlgoeshere');
    Computers are simple for the complex mind, yet complex for the simple mind

  • #5
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, here's the code from that page that does it...
    Code:
     var out = "cinderella";
     i = cinderella;
     if (snowwhite> i) { out = "snowwhite"; i = snowwhite; }
     if (ariel> i) { out = "ariel"; i = ariel; }
     if (cinderella> i) { out = "cinderella"; i = cinderella; }
     if (belle> i) { out = "belle"; i = belle; }
     location.href = out + ".html";

  • #6
    Have1abanana
    Guest
    Thanks for helping a Javascript thicky

    I think I've grasped the concept




  •  

    Posting Permissions

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