![]() Preserved Topic: Reading values from a url? (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: Brisbane, Australia |
![]() 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 |
![]() 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 |
![]() Cool, I didn't know about .indexOf, I'll have to play around with this... |
Paranoid (IV) Inmate From: Lebanon |
![]() code: if (location.search.match(/\?(.+)/))
|