SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict djh's Avatar
    Join Date
    Apr 2000
    Location
    Long Beach, CA
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    get URL encoded variable

    Hi -

    How do I retrieve the value of a URL encoded variable using only javascript?

    example: www.dave.com?id=1

    I want to get the 1 into a javascript variable...

    Thanks,
    Dave

  2. #2
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm assuming you are using ASP, but this should work with all scripting languages. You could just write the value out like so.

    Code:
    myVar = <%= Request.QueryString("ID") %>;


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
  •