문제

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?

도움이 되었습니까?

해결책

The problem is a simple typo:

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

should be

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

See here

다른 팁

@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>");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top