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

Change content type

Status
Not open for further replies.
Joined
Jul 29, 2005
Messages
136
Location
PT
Hi,

Is it possible to change the content type in client side, using javascript?

For instance, if I get a xml string (calling a web service or whatever) is it possible to render that xml string as a xml file in the same window of the browser (or in a frame in that window, making a document write or something like that). I would like to do it without having to save the string to a file in the file system.

The problem is that I´m using the return value from a web service. In an asp page I could force the content type in the web server, however, as far as I know, I can´t do it using a web service.

Thank you
 
I know that document.open takes a parameter which specifies the content-type, but I've never seen it used in practice. Worth a look, though.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hello,

I already tried that but with no success. Its strange that the method accept that parameter and than it doesn´t work. In fact the xml type is not what I need but excel/word type, however what I get is always an html file...

Any one tried that?

thank you
 
Hi,

Billy, Unfortunatly I don´t think so, because at server side I have an web server an not an asp site.

Thank you
 
You should be able to configure your web server to deliver things as a certain MIME type - ask in the forum for your web server software.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
DAn

My web server is IIS, however the repsonse is in a web service. Can I set the mime type of a web service resposnse?

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top