Pregunta

I'm having a surprising issue: I've created a method to underline it:

protected native String jsAppendChild(Element item)/*-{
    var div = $doc.createElement("div");
    div.innerHTML = "hey do you see me";
    item.appendChild(div);
}-*/;

calling this method on a GWT Element doesn't add the element to the DOM!?

Any explanations?

¿Fue útil?

Solución

The problem is a simple typo:

div.innerHtml = "hey do you see me";

should be

div.innerHTML = "hey do you see me";

See here

Otros consejos

@Baz is right, if you are familiar with jQuery, you can use GQuery as well:

GQuery.$(item).append("<div>Ey do you see me?</div>");
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top