Solved

Limit on arguments passed to window.location.href

Posted on 1998-07-07
7
568 Views
Last Modified: 2008-02-01
Hi,

I'm writing some JavaScript code.
I have to pass a faily long string as an argument
to window.location.href in the form:

window.location.href = commandbar.asp?nav_btn=nav_btn_SaveRecord&LocalVersion=5&nOrginatorID=10&nSubstateID=7 etc...

This line fails in IE4 with the following error message:
"Invalid pointer"

Any ideas?
thanks,
ralph
0
Comment
Question by:rakhras
  • 4
  • 2
7 Comments
 

Author Comment

by:rakhras
ID: 1266283
Edited text of question
0
 
LVL 28

Expert Comment

by:sybe
ID: 1266284
i am not sure, you might try to use urlencode:

window.location.href=escape("commandbar.asp?......")


0
 

Author Comment

by:rakhras
ID: 1266285
sybe,

i forgot to mention that i already escape() my string.

ralph.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:rakhras
ID: 1266286
Adjusted points to 100
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1266287
1. if you also have No Such Interface supported errors you have a sick IE4 try http://www.ie4.mcmail.com/ for a fix

Also search for *16.dll - if you find vscrpt16.dll and
jscrpt16.dll you need to reinstall IE4.01 so you get
VBSCRIPT.DLL and JSCRIPT.DLL and the latest scripting engine (3.01?)

2. Shorten your variables, assuming the error goes away when the URL is short enough

3. (Use a hidden form and) submit it with post instead
<FORM NAME="HIDFORM" ACTION="commandbar.asp" METHOD="POST">
<INPUT NAME="nav_btn" TYPE="HIDDEN" VALUE="">
</FORM>
<SCRIPT>
document.HIDFORM.nav_btn.value = 'nav_btn_SaveRecord&LocalVersion=5&nOrginatorID=10&nSubstateID=7 etc...'
document.HIDFORM.submit();
</SCRIPT>

This is assuming you do not want to submit the original form...

Michel
0
 

Author Comment

by:rakhras
ID: 1266288
Michel,

We just finished trying a variation of your third suggestion
(i.e. using post and submit) and it worked fine.
If you want the points, you can answer the question now.

thanks,
ralph

0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 100 total points
ID: 1266289
Thanks ralph!
I am glad it worked
Michel
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jquery - show / hide div depending on day and time 19 46
jQuery Validate 4 36
maps stopped work unsure why 7 34
Angular service to share objects between controllers 1 15
This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question