JavaScript : GET variable from query string

1
2
fullURL = parent.document.URL
GetVar = fullURL.substring(fullURL.indexOf('?')+xxx, fullURL.length)

? = variable name
xxx = length of GET variable name.

Example.

1
2
fullURL = parent.document.URL
GetVar = fullURL.substring(fullURL.indexOf('topicid')+7, fullURL.length)

Written by Komkid on August 5th, 2009 with no comments.
Read more articles on JavaScript and Programming.

Related articles

No comments

There are still no comments on this article.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:

You have to be identified to write a comment.