You add 2 separate elements:

First add a ScriptElement containing the external JavaScript

Next, add an InlineHTML element to contain the button html.





On Oct 26, 6:55 pm, vokke <vkub...@gmail.com> wrote:
> Hi Bryan,
> many thanks for your answer. But I need more help, I'm afraid...
> I tried the following:
>
> <code>
> Document doc = Document.get();
> ScriptElement script = doc.createScriptElement();
> script.setSrc("http://s7.addthis.com/js/250/
> addthis_widget.js#pub=xa-4ae3631c6412b94f");
> script.setType("text/javascript");
> script.setInnerHTML("<a class=\"addthis_button\" 
> href=\"http://www.addthis.com/bookmark.php?v=250&pub=xa-4ae3631c6412b94f\";><img
> src=\"http://s7.addthis.com/static/btn/v2/lg-bookmark-en.gif\"; width=
> \"125\" height=\"16\" alt=\"Bookmark and Share\" style=\"border:0\"/></
> a>");
> doc.getBody().appendChild(script);
> </code>
>
> But nothing showed up. Is it correct to user "setInnerHTML" here?
> Or how can I link the script and the html-Tag?
>
> Thanks for any clue,
> Vokke
>
> On 24 Okt., 23:12, Bryan <bryan.verg...@gmail.com> wrote:
>
> > Add the <script> separately:
>
> > Document doc = Document.get();
> > ScriptElement script = doc.createScriptElement();
> > script.setSrc("http://...";);
> > doc.getBody().appendChild(script);
>
> > Then you can add the rest of the HTML and it should work.
>
> > b
>
> > On Oct 24, 1:32 pm, vokke <vkub...@gmail.com> wrote:
>
> > > Hello newsgroup.
> > > I want to insert anaddthis-button to my GWT-Project.
> > > When I try to insert the html-code into an HTML-Widget or HTMLPanel-
> > > Widget, the button shows up,
> > > but does not work properly.
> > > It als works when I put it inside the <body>-tags on the base html
> > > page.
> > > What do I do wrong?
>
> > > Here's theaddthis-button code:
> > > <code>
> > > <!--AddThisButton BEGIN -->
> > > <a class="addthis_button" href="http://www.addthis.com/bookmark.php?
> > > v=250&amp;pub=xa-4ae3631c6412b94f"><img src="http://s7.addthis.com/
> > > static/btn/v2/lg-bookmark-en.gif" width="125" height="16"
> > > alt="Bookmark and Share" style="border:0"/></a><script type="text/
> > > javascript" src="http://s7.addthis.com/js/250/
> > > addthis_widget.js#pub=xa-4ae3631c6412b94f"></script>
> > > <!--AddThisButton END -->
>
> > > </code>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to