![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
On Dec 13, 9:38 pm, Thomas 'PointedEars' Lahn <PointedE... (AT) web (DOT) de wrote: MSHTML-based user agents at least since version 4.0 (e.g. IE 4.0+ for Windows) and Gecko-based UAs since version 1.8 (e.g. Firefox 1.5+) [1] support document.open("text/plain"); document.write("foo\nbar"); document.close(); Yeah, I forgot to mention: that is your fantasy, IE never supported anything but "text/html" for MIME in document.open method. |
|
Actually MSDN is very explicit about it as well: http://msdn2.microsoft.com/en-us/library/ms536652.aspx "text/html Default. Currently the only MIME type supported for this method." |
|
By using document.open('text/plain') one trigs "unsupported MIME type argument protection" in IE with some very funny consequences. |
#2
| ||||||||
| ||||||||
|
|
[...] Thomas 'PointedEars' Lahn [...] wrote: VK wrote: [...] Thomas 'PointedEars' Lahn [...] wrote: MSHTML-based user agents at least since version 4.0 (e.g. IE 4.0+ for Windows) and Gecko-based UAs since version 1.8 (e.g. Firefox 1.5+) [1] support document.open("text/plain"); document.write("foo\nbar"); document.close(); Yeah, I forgot to mention: that is your fantasy, IE never supported anything but "text/html" for MIME in document.open method. You are confusing things, the expert on publishing fantasies is *you*. I have of course *tested* the above statement positive You may rethink your idea of "positive test" a.s.a.p. then. |
|
var w = window.open('about:blank'); |
|
/* timeout is only to avoid * ideas of page not ready yet * and similar */ window.setTimeout('f()',1000); function f() { w.document.clear(); |
|
clear Method Not currently supported. To clear all elements in the current document, use document.write(""), followed by document.close." Standards Information This method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web [DOM]. |
|
w.document.open('text/plain'); w.document.write('foo\nbar'); w.document.close(); } /script /body /html 1) Open the page in IE 6. 2) In the popup window wait a sec until "foo bar" text appears. 3) In the popup window choose File / Save As... / 4) Default file type is HTML, not TEXT |
|
5-a) Click OK and observe that the saved page is not from pupup, but the stating one with the script - but converted to Unicode with BOM in front of the first tag. No foo, no bar. |
|
5-b) Manually change to Text File and save. OK, kind of working but still in Unicode (line breaks mistreated if no Unicode support in the text viewer). |
|
5-c) Instead of "about:blank" use an initial text file. Observe no difference in the behavior. 6) Enjoy. |
![]() |
| Thread Tools | |
| Display Modes | |
| |