Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.location with long querystring

Status
Not open for further replies.

philhege

Programmer
Feb 1, 2001
2,114
US
I need to redirect to another page, but the querystring I must append to the URL is long. My code works without the querystring, but gives "invalid syntax" when I add it to the location value.

So,

window.location.href = '
works, but

window.location.href = '
throws an 'invalid syntax' error. What is the length limit for a JS querystring value?


tks,

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
I'm guessing your query string will work if you put an escaped value in for value=.
 
Thanks for the input. The string was already encoded for a URL; what would I need to escape?

BTW I changed my approach to POST instead of GET. I pass the value in a hidden form field; works great:

<body>Please wait while your order processes.</body>
<form name="sendit" action=" target="_top" method="post">

<input type="hidden" name="order" value="TheOrderXMLString">

</form>

<script language="JavaScript1.2">sendit.submit()</script>

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top