BUG (kind of) - chrome create(img) fail

4 views
Skip to first unread message

ern0

unread,
Jan 13, 2010, 6:03:35 AM1/13/10
to domass...@googlegroups.com
Creating an image element with DomAss leads Chrome to fail.

Let's see.
create(name, attr, append, content)

Regardless of append mode (append/replace) the content is getting into
the element. When the name (element type) is an img, it's not OK for
Chrome. (Anyway, Firefox accepts it.)

<img src="x"> that's Crome doesn't like </img>

I think, if the content is empty and the mode is append, there should no
content to be written into the element just created. Or tag name should
be checked if it's img (are there other else tags same kind of?).
--
ern0.scene.plus4.amiga.code.muzak
Haben Sie Fragen?

Samuel Desnoës

unread,
Jan 13, 2010, 8:24:47 AM1/13/10
to DOMAssistant
Hi,

No content for images...
Content argument is optionnal in the DA.create syntax.

Try this :
$(document.body).create("img", {width : 200, height : 200, alt : "Test
image"}, true);

Hope that helps.
Best regards,

Sam

Samuel Desnoës

unread,
Jan 13, 2010, 8:28:49 AM1/13/10
to DOMAssistant
Sorry,
Here's the correct syntax :
$(document.body).create("img", {src: "x.jpg", width : 200, height :

ern0

unread,
Jan 13, 2010, 3:07:42 PM1/13/10
to domass...@googlegroups.com

Yep, that's it. The bug was so deep, that I was complete confused
(WigetController - WidgetContainer - WidgetComponent >>ihneritance>>
DimWidget). Thanx!

Reply all
Reply to author
Forward
0 new messages