Preserved Topic: Calling different scripts (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: there...no..there..... |
posted 02-21-2002 16:24
How can I call a different script depending on what browser the page is viewed in. I have a script that works as a browser sniffer and then depending on what browser is being used it calls a different script. code: //Do some browser sniffing and determine if it can display the JavaApplet
|
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 02-21-2002 17:03
Say you had this: |
Maniac (V) Inmate From: there...no..there..... |
posted 02-21-2002 17:24
Doh!!!! I got one of the escapes in there but I forgot about the / on the </script> tag! |
Maniac (V) Mad Scientist From: New California |
posted 02-21-2002 17:52 |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 02-21-2002 17:53
Well, understand that the "/" character is completely fine in strings without being escaped. It's just that when the browser sees </script> it thinks your script has ended, and that you forgot to end your string. |
Maniac (V) Inmate From: there...no..there..... |
posted 02-21-2002 20:18
I just thought of something. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 02-21-2002 21:27
If you can test, test. There are really a lot more browser versions than we pretend, if you count minor versions and bug fixes, and then there are browsers that you and I don't even know about, etc. |
Maniac (V) Inmate From: there...no..there..... |
posted 02-21-2002 21:37
I have a pretty extensive list of browsers for detection. The only problem is, is that they may a browser that can use Java but have it disabled. |