Use double quotes to wrap the whole event argument, then use single quotes for the parameters.
AFAIK, the onerror event attribute is not part of the current html standard (4.0). What's the purpose of this "gag" function you call there?
Thanks for your speedy reply Banal, here is the truth of it. i don't know anything useful about JS, however, i know a guy who does, and i asked him to create some simple image rollover pop-ups for me he did so but when he discovered SS "cleaned" the code, rather than fix it, he disabled TinyMCE altogether and input the code.
This works in FF3 ie7 and ie6 in a nearly uniform way, but it is of course now no use to the guy i am building it for as he cannot edit any of his site without knowledge of HTML (which he does not possess) SO i am trying to un-break the editor without breaking the code that is already there... so as you could imagine... all help gratefully received... i am a Designer, not a Developer.
so as to the "Why's" of the code, i have no idea. :-/
I see. I really doubt, that the onerror event will even be fired.. so there's not much sense in including this.
You should be able to enter your code in TinyMCE if you stick to the quotation rules I posted (http://www.w3schools.com/HTML/html_attributes.asp). Attributes without quotes.. that's coming straight from the nineties :)
If you're using these scripts for a lot of images, it would be a lot easier if you (your programmer) wrote some jQuery functions that add the event handlers to the elements automatically (on page load).