This is a discussion on "[SOLVED] Switch(score)" within the JavaScript Forum section. This forum, and the thread "[SOLVED] Switch(score) are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Switch(score)
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[SOLVED] Switch(score)
I try to create an IQtest for my homepage, and have downloaded a JavaScript code from another site with permission from the author, but I cant contact the author at his email anymore unfortually, so thats why I place my question in this forum.
Now to the problem: On my IQtest which is located here http://yalla.dk/projectjs/test.htm ( not finished ) Ive some different cases in my test.js ( see code below ) if the person has 0 correct, it will show this site http://yalla.dk/projectjs/result.html?result=0 - if the person score 1 correct, it will show this site http://yalla.dk/projectjs/result.html?result=1 and so on. But my problem is when the person score 10 correct ( http://yalla.dk/projectjs/result.html?result=10 ) then the site display its like only 1 correct, this problem only occure when user get 10 or more correct - mayby its because that 10/11/12 is a two digis number? I hope you people out there understand what I mean, and can help me to away with this big problem. test.js
Last edited by Jack Franklin; Mar 23rd, 2008 at 10:53. Reason: Added [code] tags. |
|
|
|
#2
|
|||
|
|||
|
Re: Switch(score)
Hello again.
I will you say that my problem now is solved ;-) Sorry, Jack Franklin for not putting the JavaScript in the code tags, I will try to remember this next time ;-) |
|
#3
|
||||
|
||||
|
Re: Switch(score)
Could you post the solution for other users please?
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
#4
|
|||
|
|||
|
Re: Switch(score)
The solution was to replace following code.
var result=location.search.substr(8,1); with var result=window.location.search.substr(8); |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can you beat my score? | Prestonlee | Webforumz Cafe | 13 | Nov 24th, 2007 00:34 |
| Switch to linux? | alexgeek | Webforumz Cafe | 7 | Oct 10th, 2007 21:00 |
| switch post | alexgeek | PHP Forum | 12 | Sep 25th, 2007 10:04 |
| CSS style switch | Heavensword | Web Page Design | 3 | Jul 24th, 2007 15:24 |
| hi score table | timmytots | PHP Forum | 3 | Aug 19th, 2006 18:54 |