DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Jun 2006

    Delete me

    I can't get this to work. I grabs the variable after the "?" and leaves out any "%" or "2" or "0". There are only 13 department names going to be passed through, so I don't need to wory about #'s.

    It did work in FF until I tried to add browser compatability since it has to be IE and FF compliant. I am confused why this does not work. Thanks for your time.

    if (document.getElementById)
    {var strvar = document.getElementById("url").indexOf('?');}
    {var strvar = document.url.indexOf('?');}

    if (strvar != -1)
    if (document.getElementById)
    {strsearch = document.getElementById("url").substring(strvar+1, document.getElementById("url").length);}
    {strsearch = document.url.substring(strvar+1, document.url.length);}

    for (count = 0; count < strsearch.length; count++)


    if (strsearch.charAt(count) == "%")
    {document.write (" ");}

    else if (strsearch.charAt(count) == "2")
    {document.write (" ");}

    else if (strsearch.charAt(count) == "0")
    {document.write (" ");}


    {document.write (strsearch.charAt(count));}


    {document.write("No Department Selected");}
    Last edited by buma; 07-05-2006 at 04:26 PM.

Similar Threads

  1. How to retain session variable
    By NikhilSriv in forum Java
    Replies: 1
    Last Post: 06-14-2006, 05:24 AM
  2. Encypting a URL
    By John Butler in forum ASP.NET
    Replies: 0
    Last Post: 11-26-2002, 03:53 PM
  3. Replies: 1
    Last Post: 11-28-2001, 03:43 AM
  4. Caching the URL
    By gvt in forum VB Classic
    Replies: 0
    Last Post: 02-07-2001, 08:47 AM
  5. Caching the URL
    By gvt in forum VB Classic
    Replies: 0
    Last Post: 02-07-2001, 08:47 AM

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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.