POV-Ray : Newsgroups : povray.off-topic : More web madness Server Time
3 Sep 2024 17:20:10 EDT (-0400)
  More web madness (Message 1 to 10 of 18)  
Goto Latest 10 Messages Next 8 Messages >>>
From: Invisible
Subject: More web madness
Date: 22 Sep 2010 06:40:10
Message: <4c99dd0a$1@news.povray.org>
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

From: Invisible
Subject: Re: More web madness
Date: 22 Sep 2010 06:53:40
Message: <4c99e034$1@news.povray.org>
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

From: Phil Cook v2
Subject: Re: More web madness
Date: 22 Sep 2010 09:50:22
Message: <op.vjfsqez8mn4jds@phils>
And lo On Wed, 22 Sep 2010 11:40:08 +0100, Invisible <voi### [at] devnull> 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

From: Invisible
Subject: Re: More web madness
Date: 22 Sep 2010 09:54:01
Message: <4c9a0a79$1@news.povray.org>
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

From: nemesis
Subject: Re: More web madness
Date: 22 Sep 2010 13:04:43
Message: <4c9a372b$1@news.povray.org>
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

From: Invisible
Subject: Re: More web madness
Date: 23 Sep 2010 04:06:36
Message: <4c9b0a8c$1@news.povray.org>
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

From: nemesis
Subject: Re: More web madness
Date: 23 Sep 2010 14:19:45
Message: <4c9b9a41@news.povray.org>
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

From: Orchid XP v8
Subject: Re: More web madness
Date: 23 Sep 2010 15:39:13
Message: <4c9bace1$1@news.povray.org>
>> 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

From: Invisible
Subject: Another day
Date: 28 Sep 2010 07:57:41
Message: <4ca1d835$1@news.povray.org>
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

From: Warp
Subject: Re: Another day
Date: 28 Sep 2010 08:22:09
Message: <4ca1ddf1@news.povray.org>
Invisible <voi### [at] devnull> 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

Goto Latest 10 Messages Next 8 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.