![]() |
Reach IF statment from address field
Hi!
Is there any way to reach a IF ELSE statment via the address filed? Like there is with the GET method for PHP? For example index.html?car=mercedes writes or reqiure a file, that should have been viewed if the variable cars value was "mercedes"? :) / Vilhelm |
you can check the value of the query string like this:
Code:
var car=window.location.search.substring(1).split("=")[1]; |
Allowing for missing parameter:
Code:
var car=window.location.search.substring(1).split("="); |
fair enough. seems overly cautious though... if the string is
index.html?car=then window.location.search.substring(1).split("=")[1]will return blank, which obviously != "mercedes", so why? |
Quote:
|
| All times are GMT +1. The time now is 05:52 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.