SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2002
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Javascript Querystrings

    Is there a way to read a querystring with javascript? How do i do this?

    Also can javascript get the url in the address bar of the browser of the current page you are on.

    If anyone can help me out with this i would appreciate it. I have been looking for these and so far i am unable to lacate what i need.


    Thanks

    n3urai
    Keep It Real

  2. #2
    SitePoint Evangelist compwizard's Avatar
    Join Date
    May 2002
    Location
    United States
    Posts
    457
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    something like this perhaps??

    PHP Code:
    // Assuming URL is something like: 
    // [url]http://www.domain.com?name=John[/url]

    var URL = new String(parent.document.location);
    var 
    item URL.split("?");
    var 
    single item[1].split("=");


    single[0] = name
    single
    [1] = fname 
    Taken from here: http://p2p.wrox.com/archive/javascript/2001-02/11.asp

    Thread looks very useful!!
    Compwizard
    "There are 10 kinds of people in this world -- those who know binary, and those who don't."


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •