+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Tec
    Tec is offline
    Member
    Join Date
    Jan 2003
    Posts
    152

    How to get url parameters with javascript?

    Could someone please tell me how to retrieve a value from a parameter passed through a url using javascript?

    if some dude typed: http://www.site.com/test.htm?var=500
    and I wanted to use that VAR inside the javascript code, how would I get its value?

  2. #2
    Junior Member
    Join Date
    May 2005
    Posts
    19
    OK I don't know if this helps at all but It can be done in PHP like this
    Code:
    $var = $_REQUEST['var'];
    I'm not sure if it's similar with Java script sorry

    James

  3. #3
    Ultimate Member
    Join Date
    Jan 2003
    Location
    MA / NH
    Posts
    1,497
    Quote Originally Posted by James342
    OK I don't know if this helps at all but It can be done in PHP like this
    Code:
    $var = $_REQUEST['var'];
    I'm not sure if it's similar with Java script sorry

    James
    Nope, it's almost that easy, but I forget the all of the code. I can get you an exact answer later today when I get home from school, but all I can think of off of the top of my head is the code to seperate the varibles from the URL.


    -Blaze

  4. #4
    Tec
    Tec is offline
    Member
    Join Date
    Jan 2003
    Posts
    152
    ohhh ok, I'd appreciate it a lot Blazer06!!! thanks!

Quick Reply Quick Reply

If you are already a member, please login above.

What planet do we live on?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pointers as parameters...HELP!
    By squeech in forum Webmastering and Programming
    Replies: 1
    Last Post: September 16th, 2003, 10:45 PM
  2. Help...Error msg: "Incorrect command line parameters". Windows Installer?
    By thunderb0lt in forum Applications and Operating Systems
    Replies: 7
    Last Post: August 22nd, 2003, 07:22 AM
  3. HD parameters ??
    By luismaini in forum Storage Related
    Replies: 2
    Last Post: August 15th, 2003, 02:13 AM
  4. Passing parameters
    By Ram09 in forum Webmastering and Programming
    Replies: 2
    Last Post: September 4th, 2002, 03:11 PM

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright 2014 All Enthusiast, Inc