Setting the InnerHTML is a mistake.

Try this:

Image img = new Image(url);
img.getElement().getStyle().setProperty("align", "right");
RootPanel.get().add(img);

Or if you want to insert it into a specific "div" in the host page,
replace the RootPanel call with:

DOM.appendChild(DOM.getElementById("your_div_id"), img);

-Brett


On Jul 6, 6:01 am, "[email protected]"
<[email protected]> wrote:
> I would like to add an image to the host page after a particular
> moment and to do this i try this code:
>
> Document d= Document.get();
> Element image=d.createElement("img");
> image.setInnerHTML("src=\"images/GoogleCode.png\" align=\"right\"");
>
> why it doesn't work and what changes i can apply?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to