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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.open and problems with content-type

Status
Not open for further replies.

s0s

Programmer
Sep 7, 2004
4
PL
Hi

I'm trying to generate site source dynamically at the server side (PHP) and show it in new window in client browser.

In javascript I have new window creation:
var winref = window.open('', 'Form', 'left=20, top=20);
winref.document.writeln(response);
winref.document.close(response);

and the "response" comes from:
var response = HttpRequest.responseText;

On the server side I have easy code (server.php):
<?php
header ("Content-type: application/vnd.mozilla.xul+xml; charset=iso-8859-15");

... rest of site (in XUL)

?>

Server side looks fine: works great and the content-type is correctly XUL

But if I use javascript and window.open I have still content-type "text/xml" and it's not so fun :(

How can I change this?
I've found this way

httpRequest.setRequestHeader("Content-Type", "application/vnd.mozilla.xul+xml");

but it still don't solve my problem :(

--
sebo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top