HighDots Forums  

Re: Internet Explorer XHTML window.onload issue

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Internet Explorer XHTML window.onload issue in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Internet Explorer XHTML window.onload issue - 12-18-2007 , 03:13 PM






AndreHaupt wrote:
Quote:
Oh that's IE7
Microsoft Internet Explorer does not support XHTML natively to date, nor is
XHTML required here. Serve HTML 4.01 as text/html and many problems will go
away.

You should also use the standardized intrinsic event handler `onload'
attribute of the `body' element instead of the proprietary event handler
property `onload' of the host object referred to by the host-defined
`window' property of the Global Object (or another object in the scope chain).

BTW, ignore VK.


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann


Reply With Quote
  #2  
Old   
VK
 
Posts: n/a

Default Re: Internet Explorer XHTML window.onload issue - 12-18-2007 , 04:15 PM






On Dec 18, 11:13 pm, Thomas 'PointedEars' Lahn <PointedE... (AT) web (DOT) de>
wrote:
Quote:
You should also use the standardized intrinsic event handler `onload'
attribute of the `body' element instead of the proprietary event handler
property `onload'
A very bad advise from the point of view of content-layout-scripting
separation: to hardcode some function call into HTML/XHTML tags. What
exactly standardization body does suggest such approach?


Reply With Quote
  #3  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Internet Explorer XHTML window.onload issue - 12-18-2007 , 04:26 PM



VK wrote:
Quote:
On Dec 18, 11:13 pm, Thomas 'PointedEars' Lahn <PointedE... (AT) web (DOT) de
wrote:
You should also use the standardized intrinsic event handler `onload'
attribute of the `body' element instead of the proprietary event handler
property `onload'

A very bad advise from the point of view of content-layout-scripting
separation:
Nonsense. Whether either the `script' element contains an assignment of a
reference to a Function object to `window.onload' (or performing an
equivalent), or the `script' element to contain a function declaration and
the `onload' property of the `body' element to contain a call to that
function makes no real difference. The script is always tied to and
tailored to the markup.

The real difference here is that the `onload' property is proprietary, and
both it and a standards-compliant equivalent would require feature-testing
for themselves, while the `onload' attribute is standardized as per HTML
4.01 (and supported long before that) and requires no feature-testing on itself.


PointedEars


Reply With Quote
  #4  
Old   
VK
 
Posts: n/a

Default Re: Internet Explorer XHTML window.onload issue - 12-18-2007 , 05:23 PM



Quote:
You should also use the standardized intrinsic event handler `onload'
attribute of the `body' element instead of the proprietary event handler
property `onload'

A very bad advise from the point of view of content-layout-scripting
separation:

Nonsense. Whether either the `script' element contains an assignment of a
reference to a Function object to `window.onload' (or performing an
equivalent), or the `script' element to contain a function declaration and
the `onload' property of the `body' element to contain a call to that
function makes no real difference. The script is always tied to and
tailored to the markup.
Nonsense. :-)

<body onload="someFunction()"> for each and any script on the page
will try to launch someFunction and it better be in the script and
really being the one needed onload. This way you create a hardcoded
link between your HTML structure and your script structure. In some
organizations it can be a conversion about the onload function name,
say Java-inspired init() as in my company but there is not such
convention on any wide run.

Quote:
The real difference here is that the `onload' property is proprietary, and
both it and a standards-compliant equivalent would require feature-testing
for themselves
Double nonsense unless NN4 or lower is a requirement. However I liked
NN I said goodbye to it long ago, so all other descent people did.


Reply With Quote
  #5  
Old   
AndreHaupt
 
Posts: n/a

Default Re: Internet Explorer XHTML window.onload issue - 12-19-2007 , 02:29 AM



On Dec 18, 11:26 pm, Thomas 'PointedEars' Lahn <PointedE... (AT) web (DOT) de>
wrote:
Quote:
VK wrote:
On Dec 18, 11:13 pm, Thomas 'PointedEars' Lahn <PointedE... (AT) web (DOT) de
wrote:
You should also use the standardized intrinsic event handler `onload'
attribute of the `body' element instead of the proprietary event handler
property `onload'

A very bad advise from the point of view of content-layout-scripting
separation:

Nonsense. Whether either the `script' element contains an assignment of a
reference to a Function object to `window.onload' (or performing an
equivalent), or the `script' element to contain a function declaration and
the `onload' property of the `body' element to contain a call to that
function makes no real difference. The script is always tied to and
tailored to the markup.

The real difference here is that the `onload' property is proprietary, and
both it and a standards-compliant equivalent would require feature-testing
for themselves, while the `onload' attribute is standardized as per HTML
4.01 (and supported long before that) and requires no feature-testing on itself.

PointedEars

I have considered moving back to 4.01, but I get layout issues (DIV
positioning).

I'll find some midway between the two. Thanks for your reply.


Reply With Quote
  #6  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Internet Explorer XHTML window.onload issue - 12-19-2007 , 05:17 PM



AndreHaupt wrote:
Quote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
The real difference here is that the `onload' property is proprietary, and
both it and a standards-compliant equivalent would require feature-testing
for themselves, while the `onload' attribute is standardized as per HTML
4.01 (and supported long before that) and requires no feature-testing on itself.
[...]

I have considered moving back to 4.01, but I get layout issues (DIV
positioning).
Probably you have done something else wrong. Anyhow, XHTML 1.0 also
provides the `onload' attribute, of course. So that alone is no sufficient
reason to use HTML 4.01 in favor of XHTML 1.x; however, insufficient XHTML
support, as I pointed out earlier, is.

Quote:
I'll find some midway between the two.
You can't have both. HTML-compatible XHTML is an illusion.

Quote:
Thanks for your reply.
You're welcome.


PointedEars
--
"Use any version of Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.