Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > onresize()?

onresize()?
Thread Tools
DUNSEL
Forum Regular
Join Date: Feb 2004
Location: Manhattan
Status: Offline
Reply With Quote
May 11, 2004, 10:55 AM
 
I have a call in the body tag of a page onresize="functionname()" however the w3c validator keeps kicking it back to me, saying it's not HTML 4.01 transitional. I've also tried window.resize. Any clues? It fires in all browsers I've tested, so it's not an IE only thing.
I saw a woman with a sweatshirt that said "Guess", so I said, "Implants?"
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
May 11, 2004, 11:17 AM
 
Now that is strange - I didn't know that it wasn't part of the 4.01 specification, but apparently it isn't...

I suppose this hints as to why the events are handled differently in Moz and IE (I think Moz only fires it when the resize has stopped, but IE continuously fires it until you stop...)

I'm just going to find out where it is laid down as a standard, out of interest.
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
DUNSEL  (op)
Forum Regular
Join Date: Feb 2004
Location: Manhattan
Status: Offline
Reply With Quote
May 11, 2004, 11:22 AM
 
I've looked. It's not listed in the w3schools event handler list, and not on mozilla's either, yet they support it, as does Netscrape.
I saw a woman with a sweatshirt that said "Guess", so I said, "Implants?"
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
May 11, 2004, 11:43 AM
 
Well, Netscape would if Mozilla does........

It seems to me that this is a bit like the whole .innerHTML thing. Not a written standard, but widely used because of its usefulness. And it's been around for a hell of a long time (in HTML years), so I wonder why it isn't a proposed standard (or have I just missed it).

I thought it might appear here, but it didn't...

Ho-hum... I'll keep on searching - this is something I never knew about, and I'd really like to find the answer now...
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
DUNSEL  (op)
Forum Regular
Join Date: Feb 2004
Location: Manhattan
Status: Offline
Reply With Quote
May 11, 2004, 11:48 AM
 
Thanks. It's the only thing holding up validation of the page. If I remove it, it validates. In fact, if I remove it and add a few /> to empty tags, it validates as XHTML. But this one call is not part of any standard. I've looked everywhere. JS has 13 event handlers listed, and this ain't among em. The only place it shows in on the MS site, but that's it.
( Last edited by DUNSEL; May 11, 2004 at 11:54 AM. )
I saw a woman with a sweatshirt that said "Guess", so I said, "Implants?"
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
May 11, 2004, 12:04 PM
 
Right - apart from SVG methinks onresize as an attribute is nowhere to be found (in w3c standards, that is).

It seems to me that if validation is important, you'll probably need to go with document.addEventListener
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
DUNSEL  (op)
Forum Regular
Join Date: Feb 2004
Location: Manhattan
Status: Offline
Reply With Quote
May 11, 2004, 12:49 PM
 
It's really not that important, but as long as JS recognizes the event handler, and HTML 4.01 doesn't,the this might solve the problem:

onresize = function() { whatever () };

Put the call in the script, and to heck with the HTML.
I saw a woman with a sweatshirt that said "Guess", so I said, "Implants?"
     
DUNSEL  (op)
Forum Regular
Join Date: Feb 2004
Location: Manhattan
Status: Offline
Reply With Quote
May 11, 2004, 01:14 PM
 
Yep, that did it. Validates, and the function still fires. Thanks for caring. LOL!
I saw a woman with a sweatshirt that said "Guess", so I said, "Implants?"
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:13 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,