By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,177 Members | 702 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,177 IT Pros & Developers. It's quick & easy.

onerror not a valid attribute for <img>

Plater
Expert 5K+
P: 7,872
I am using the onerror event for the image tag in an attempt to save overhead for my server (which will be on a microprocessor)
Basicly it tries to load the images from a real server on the internet, if it throws the onerror event, then it grabs them from the microprocessor.

This appears to work in both IE and FireFox, but the W3 validator says it's not a valid attribute.
It's all in lowercase and I am using the correct doctype for xhtml transitional.

Is onerror really not a valid attribute? Do I just need to add something somewhere or call it something else?
Jul 23 '07 #1
Share this Question
Share on Google+
3 Replies

epots9
Expert 100+
P: 1,351
Complete list of what u can use with the <img> tag.

u'll have to call it another way if u want to be a valid xhtml.

good luck
Jul 23 '07 #2

Plater
Expert 5K+
P: 7,872
hmm. I may have to eat it and not be xhtml correct.
That ability is pretty key.
Jul 23 '07 #3

pbmods
Expert 5K+
P: 5,821
The other option would be to try to load the image using JavaScript. Speaking of reducing overhead... :)
Jul 24 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.