Preserved Topic: Reading values from a url? |
|
---|---|
Author | Thread |
Maniac (V) Inmate From: Brisbane, Australia |
posted 10-14-2001 21:23
Is it possible for Javascript to read values from a url like this: code: flag = (location.search)? 1:0
|
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 10-15-2001 00:07
Yeah, location.search will return the string "?news". If you know the string will be as simple as that, you can simply run a test: |
Maniac (V) Inmate From: Brisbane, Australia |
posted 10-15-2001 05:25
Cool, I didn't know about .indexOf, I'll have to play around with this... |
Paranoid (IV) Inmate From: Lebanon |
posted 10-15-2001 08:16
code: if (location.search.match(/\?(.+)/))
|