Link to home
Start Free TrialLog in
Avatar of jacy_m
jacy_m

asked on

Window.location error

Hi, I get an Object doesnt support this method error when I run the following code (using asp to write the javascript). What is wrong with it?

Response.write("<SCRIPT>")
Response.write("window.location.href('InvoiceDetails.asp?orderId=" & intOrder & "&err=" & strError & "');")
Response.write("</script>")
Avatar of a.marsh
a.marsh

Try:

Response.write("window.location = 'InvoiceDetails.asp?orderId=" & intOrder & "&err=" & strError & "');")

Now I don't really know ASP but you should also escape the two values aswell.

:o)

Ant
In javascript you would use the escape function like:

var url = "page.asp?orderid=" + escape("ab:995") + "&err=" + escape("This msg has spaces");

Perhaps you can the equivalent function in ASP.

:o)

Ant
Avatar of jacy_m

ASKER

what is escape mean? thanks
Avatar of jacy_m

ASKER

thanks the code without the escape seemed to load the page ok but I get an Error on page message in the bottom bar. There shouldnt have been any spaces in the url that i generated. How do i see what the error is?
ASKER CERTIFIED SOLUTION
Avatar of epeele
epeele
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In the above comment, please note that the second line of code should be on one line and not two.   Also, to answer your other question about how to view your javascript errors:  In IE, double click on the message at the bottom that says "Errors on page".  In Netscape, type "javascript:" in the address and press enter.
Avatar of jacy_m

ASKER

thanks I have it working now
Avatar of jacy_m

ASKER

I wil give the points to epeele as he provided the full solution, but i appreciate your comments a.marsh thanks again
Thanks jacy_m!
:o)

Ant