Results 1 to 2 of 2

Thread: javascript variable gettin cut short at the '?'

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2001
    Posts
    746

    javascript variable gettin cut short at the '?'

    i have the followin code in a html page:

    VB Code:
    1. <script>
    2. function countinue()
    3. {
    4. var url = "/cgi-bin/anonymous.pl?get=url=" + ourl.value + "?updatelinks=" + updatelinks.checked + "?popupwindows=" + removepopupads.checked + "?removeads=" + removeads.checked + "?removehiddencharacters=" + removehiddencharacters.checked + "?textcolor=" + textcolor.value;
    5. window.location = url;
    6. }
    7. </script>

    but when i call the function it just goes to mysite/cgi-bin/anonymous.pl and then stops at the question mark. how can i make it load the part of the variable that would be after the question mark?
    Last edited by flamewavetech; Feb 15th, 2002 at 08:05 PM.
    FlameWave Technologies - internet tools

  2. #2
    Member Vincent Puglia's Avatar
    Join Date
    Feb 2002
    Location
    where the World once stood
    Posts
    36
    Hi,

    I'm a little curious about your format. Why do you have multiple question marks (?) ? The usual practice (afaik) is to separate var/val pairs with an ampersand "&". Also what is 'get='? I'm presuming 'url' goes with 'ourl.value'

    In other words, try the following:

    var url = "/cgi-bin/anonymous.pl?url=" + ourl.value + "&updatelinks=" + updatelinks.checked + "&popupwindows=" + removepopupads.checked + "&removeads=" + removeads.checked + "&removehiddencharacters=" + removehiddencharacters.checked + "&textcolor=" + textcolor.value;

    Another problem spot is the length (I think 256 bytes is the limit, but I can be wrong, so check a manual). If I'm right, you might consider shortening your var names, especially 'removehiddencharacters'

    Vinny

    Vinny

Posting Permissions

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



Click Here to Expand Forum to Full Width