[OU] MIME-type for locally-populated windows

Fred Bone Fred.Bone at dial.pipex.com
Wed Dec 12 09:39:24 UTC 2007


On 12 Dec 2007 at 1:23, Hallvord Steen said:

> > Code of the following type:
> >
> >    var doc = window.open("output.html", "output").document;
> >    doc.open("text/plain");
> >    doc.writeln("This should be plain text");
> >    doc.writeln("This should be on the second line");
> >    doc.close();
> >
> > apparently causes IE and Firefox to associate a MIME-type of 
> "text/plain" 
> > with the contents being placed in the new window
[...]
> Well, you could try something like 
>   window.open( 'data:text/plain,First line%0aSecond line' )
> or even without a MIME type (default for data: is text/plain):
>   data:,First line%0aSecond line
> Whether that is better depends on what you're trying to do :-p

Thanks. Is this documented?

(I'm not the one trying to do this. I'm asking on behalf of a friend, to 
whom I reported a problem with the display of his pages. I have no idea 
where to look for answers, other than this list).




More information about the Opera-Users mailing list