How to Use a JavaScript Query String Parser

By Joseph Myers

You may be saying, "That's great. How do I use it?" It's very, very easy.

Note: The script probably won't work on your local computer if you have a recent browser. Due to cross-site scripting vulnerabilities some browsers won't load the files from myjs.us when they're used in a local file, due to the possibility of malicious scripts accessing local files.

An example of output from the query string:

is this:

Another Example

You can see an example of a form which submits information to itself and uses JavaScript to produce dynamic behavior after interpreting the query string by looking at the JavaScript Form Processor.

A copy of the code is here:

Conclusion

If you have questions at all, please send me an e-mail (e_mayilme[at]hotmail.com) or visit my Web site.

This article originally appeared on WebReference.com.




Page 3 of 3

Previous Page
1 2 3
 

Make a Comment

Loading Comments...

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
  •  
  •  
  •