www.webdeveloper.com
Results 1 to 4 of 4

Thread: document.URL failure in Internet Explorer

  1. #1
    Join Date
    Apr 2006
    Posts
    11

    Unhappy document.URL failure in Internet Explorer

    Hi! First question in the forum!

    I am having trouble reading my GET FORM variables in my website. I send them allright, it shows them in my adress bar, but when I write document.URL in javascript using Internet Explorer, it shows the adress until ?, nothing else!

    Example:
    The adress bar says: www.mywebsite.com/home.htm?var1=var1&var2=var2
    document.URL outputs: www.mywebsite.com/home.htm

    In firefox works fine, but in Internet Explorer no. What is happening?

    See ya!

    Gou-San

  2. #2
    Join Date
    Dec 2004
    Posts
    8,637
    document.URL is just that -- the document's URL. The rest of that is the search/query string and NOT part of the document's URL. To access the rest of it, in JavaScript, you should be using the location object. Specifically, the search/query string may be found in the following property (referenced in any of these three ways):

    top.location.search
    self.location.search
    window.location.search

  3. #3
    Join Date
    Apr 2006
    Posts
    11
    Thanks! It is working now!

    See ya!

    Gou-San

  4. #4
    Join Date
    Dec 2004
    Posts
    8,637
    You're welcome.

    Cheers.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles