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

4 vues
Accéder directement au premier message non lu

ern0

non lue,
13 janv. 2010, 06:03:3513/01/2010
à 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

non lue,
13 janv. 2010, 08:24:4713/01/2010
à 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

non lue,
13 janv. 2010, 08:28:4913/01/2010
à DOMAssistant
Sorry,
Here's the correct syntax :
$(document.body).create("img", {src: "x.jpg", width : 200, height :

ern0

non lue,
13 janv. 2010, 15:07:4213/01/2010
à domass...@googlegroups.com

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

Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message