Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-27-2012, 03:12 PM   PM User | #1
darkyeffectt
New to the CF scene

 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
darkyeffectt is an unknown quantity at this point
Question Problems with "onload" and XHTML Validation

Hello,

My name is Manuel, I am a web design student and am starting to take my first steps with web design. Recently I tried to validate

this site:

http://accesosnormalizados.com

I used the W3C validator, at first I found about 30 errors, and can correct them all except one that says: 'there is no attribute

"onload"'.

Apparently not support XHTML onload tag, and I use a Joomla extension called Vertical Menu using onload. This is a free extension

and works well but I have found it has some bugs, especially when validating the website.


The problem is at the end:



echo '<img src="modules/mod_vertical_menu/images/center.gif" style="display:none" onload="new WW.VerticalMenu({out:'.$params-> get (' categorymenu_out ', 0.8). 'over'. $ params-> get ('categorymenu_over', 1). ', duration:'. $ params-> get ('categorymenu_fade', 300). ', id:'. $ GLOBALS ['vertical_menu' ]. ', width:'. $ params-> get ('categorymenu_width', 150). '}); "alt =" "/>';

echo '</ div>';

?>

I think the extension uses the onload event to display the sub-menus when the user moves the mouse pointer over it.

What I want is to replace the onload with other event handler or some other label that is supported by XHTML and that is as similar to onload.

I would appreciate your help ...
darkyeffectt is offline   Reply With Quote
Old 12-28-2012, 08:28 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
You can't use the onload attribute on any element other than <body>.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 12-28-2012, 08:28 PM   PM User | #3
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,532
Thanks: 0
Thanked 503 Times in 494 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
If you put the JavaScript just before the </body> tag then you don't need to use onload at all.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 01-01-2013, 10:00 AM   PM User | #4
webdevs
New Coder

 
Join Date: Nov 2012
Location: India
Posts: 52
Thanks: 0
Thanked 3 Times in 3 Posts
webdevs is an unknown quantity at this point
First of all create the separat file for the java script.
webdevs is offline   Reply With Quote
Reply

Bookmarks

Tags
html & css, javascript, php, w3c validatiom

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting 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

Forum Jump


All times are GMT +1. The time now is 04:20 AM.


Advertisement
Log in to turn off these ads.