![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Take a small page, such as
<html>
<body>
<script type="text/javascript">
document.write("Hello world");
</script.
</body>
</html>
This works fine in Firefox, although it renders in quirks mode. (As
you'd expect.) Now slap an XHTML DTD onto it, and suddenly it completely
stops working. Instead, if I open the "error console", I get
Error: uncaught exception: [Exception... "Operation is not supported"
code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)"
location: "file:///C:/Test1.xhtml Line: 7"]
WTF?
Yeah, that's real helpful. :-P
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 22/09/2010 11:40 AM, Invisible wrote:
> WTF?
>
> Yeah, that's real helpful. :-P
After some investigation, it seems that all the DOM stuff works, just
not document.write(). Again, WTF?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
And lo On Wed, 22 Sep 2010 11:40:08 +0100, Invisible <voi### [at] dev null> did
spake thusly:
> Take a small page, such as
>
> <html>
> <body>
>
> <script type="text/javascript">
> document.write("Hello world");
> </script.
>
> </body>
> </html>
>
> This works fine in Firefox, although it renders in quirks mode. (As
> you'd expect.) Now slap an XHTML DTD onto it, and suddenly it completely
> stops working. Instead, if I open the "error console", I get
Works for me with a XHTML Strict in FF 3.6.10
--
Phil Cook
--
I once tried to be apathetic, but I just couldn't be bothered
http://flipc.blogspot.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 22/09/2010 02:50 PM, Phil Cook v2 wrote:
> Works for me with a XHTML Strict in FF 3.6.10
Interesting. Doesn't work for me with FF 3.5.6...
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible escreveu:
> On 22/09/2010 11:40 AM, Invisible wrote:
>
>> WTF?
>>
>> Yeah, that's real helpful. :-P
>
> After some investigation, it seems that all the DOM stuff works, just
> not document.write(). Again, WTF?
document.write is not part of DOM: you can see it simply writes new
content to the page, doesn't work by manipulating trees and nodes as in
DOM. It's a relic from pre-standardized Netscape days..., like the
blink tag... :p
--
a game sig: http://tinyurl.com/d3rxz9
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 22/09/2010 06:04 PM, nemesis wrote:
> document.write is not part of DOM:
I know that.
> you can see it simply writes new
> content to the page, doesn't work by manipulating trees and nodes as in
> DOM. It's a relic from pre-standardized Netscape days..., like the blink
> tag... :p
Well, that's very nice, but as far as I can see, there's no equivalent
way of doing what document.write does.
PS. Did <blink> ever get removed from the DTD? I really hope so...
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible escreveu:
> On 22/09/2010 06:04 PM, nemesis wrote:
>
>> document.write is not part of DOM:
>
> I know that.
>
>> you can see it simply writes new
>> content to the page, doesn't work by manipulating trees and nodes as in
>> DOM. It's a relic from pre-standardized Netscape days..., like the blink
>> tag... :p
>
> Well, that's very nice, but as far as I can see, there's no equivalent
> way of doing what document.write does.
what? like:
var foo=document.getElementById("foo");
var p=document.createElement("p");
var txt=document.createTextNode("Text in the paragraph!");
p.appendChild( txt );
foo.appendChild( p );
or something like that (it's been a while I last fiddled with DOM)...
not as practical as document.write, of course...
--
a game sig: http://tinyurl.com/d3rxz9
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>> Well, that's very nice, but as far as I can see, there's no equivalent
>> way of doing what document.write does.
>
> what? like:
> var foo=document.getElementById("foo");
> var p=document.createElement("p");
> var txt=document.createTextNode("Text in the paragraph!");
> p.appendChild( txt );
> foo.appendChild( p );
>
> or something like that (it's been a while I last fiddled with DOM)...
>
> not as practical as document.write, of course...
In particular, it works *only* if you tag the place where you want the
generated content to go, or you know enough about the static structure
of the document to be able to navigate to it.
My usual trick is to do document.write("JavaScript is enabled."). It's a
nice, simple way of determining whether the browser supports JS and has
it enabled. It's also useful for not showing buttons for features that
require JS if JS is not available...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
OK, here's a great one:
Does anybody know how to make it so that images show up normal size on a
web page, but shrink to fit the paper when the page is printed out?
(Yes, I realise that printing a web page is 92% guaranteed to fail in
all possible cases...)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible <voi### [at] dev null> wrote:
> Does anybody know how to make it so that images show up normal size on a
> web page, but shrink to fit the paper when the page is printed out?
By providing a printable version of the page, as some websites do.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |