Thursday, August 30, 2012

location.search.substring in JavaScript



location.search.substring in JavaScript extracts the values of each query string variable. It starts the index value as 1 after the "?" question mark, separated by  "&" sign.

Example: in web address:
wysiwyg_frame.html?doc_body&reference

location.search.substring(1) return doc_body
location.search.substring(2) return reference

No comments:

Post a Comment