views:

1067

answers:

3

Hello everyone,

I try to open multiple browser windows using javascript and the window.open() function. I want to pass a parameter through the query string to my new window like this:

window.open('http://www.myfoo.com/foopage.aspx?fooparm=1', '_blank');

This opens a new window with the correct address in the address bar but the browser displays a 404-not found. However, if I press enter in this new window, the page loads up correctly.

With a bit of trial and error, I found that using window.open without query string parameters works perfectly:

window.open('http://www.myfoo.com/foopage.aspx', '_blank');

Is there a limitation I should know about window.open and query string parameters? Is there another way to pass parameters to a new page in a new window?

Thank you very much in advance for your insight.

(Note: This script is generated server-side in C# and injected into the page using Ajax's ScriptManager.RegisterStartupScript.)

A: 

One thing for sure: the limitation is not tied to window.open() pre se. My server runs mod_perl, and I use GET requests in window.open() frequently.

Alsciende
A: 

try with

window.open("javascript:window.location='http://www.myfoo.com/foopage.aspx?fooparm=1'", "_blank");
andres descalzo
Sorry, I just tried it and I have the same result as I had.
Danny T.
I had the same problem with the tag "<a></a>" and this is me fix the problem I had was a 502 error. can tell if it's the same problem
andres descalzo
+3  A: 

I found why this morning:

In web.config, under globalization, the responseEncoding was set to "cp037". I changed it to "ISO-8859-15" and my windows are popping up correctly.

<globalization fileEncoding="ISO-8859-15" requestEncoding="ISO-8859-15" responseEncoding="ISO-8859-15" culture="auto" uiCulture="auto"/>
Danny T.