|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (10 bit)
|
Javascript Error
I'm getting a runtime error when I try to run a piece of JavaScript. The line that is causing the problem is the first line of an if statement:
if(QueryString != undefined && QueryString["date"] != undefined) { The error states that undefined is undefined. Note this only happens in some browsers! From some research I have found that the undefined keyword only works for some browsers has anyone got any more info on this e.g. which browsers it will work for? Can anyone come up with a workaround so that I can check if variables are undefined. Help appreciated. DJ |
|
|
|
|
|
#2 |
|
Member (7 bit)
Join Date: Sep 2002
Location: Middlesbrough, UK
Posts: 108
|
define
my guess would be do one of two things.
1) define undefined 2) if u r comparing 2 strings, shouldnt they be in quotes (i know this is the case in ASP, not sure about javascript) |
|
|
|
|
|
#3 |
|
Member (10 bit)
|
1. undefined means undefined so it can't be defined!
2. I am not comparing two strings - I am checking if a variable is defined. Anyway I have found a solution to this: if(QueryString && QueryString["date"]) { Does the job! |
|
|
|
|
|
#4 |
|
Member (7 bit)
Join Date: Sep 2002
Location: Middlesbrough, UK
Posts: 108
|
AH!
ah i see, i think i misunderstood the prob!!
still early over here lol ! |
|
|
|
|
|
#5 |
|
Member (10 bit)
|
Didn't realise there was that much of a time delay between Brum and Middlesbrough.
|
|
|
|
|
|
#6 |
|
Member (7 bit)
Join Date: Sep 2002
Location: Middlesbrough, UK
Posts: 108
|
LOL depends when u get out of bed!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|