You can add the javascript through GWT like so: // A Java method using JSNI native void sayHelloInJava(String name) /*-{ $wnd.sayHello(name); // $wnd is a JSNI synonym for 'window' }-*/;
For more examples go here: http://googlewebtoolkit.blogspot.com/2008/07/getting-to-really-know-gwt-part-1-jsni.html On Mar 17, 10:59 am, sigi <sig...@gmail.com> wrote: > Hi > > I have no experience with javascript at all. In order to talk with an > addServer I need need to add following code to my gwt app: > > <script type='text/javascript'><!--// <![CDATA[ > /* [id120894] spood.me - Sky */ > OA_show(120894); > // ]]> --></script><noscript><a target='_blank' href='http:// > d1.openx.org/ck.php?n=d78181a'><img border='0' alt='' src='http:// > d1.openx.org/avw.php?zoneid=120894&n=d78181a' /></a></noscript> > > What I've done so far is following. This works in Firefox but not in > Safari. > private void test() { > String s = "<!--// <![CDATA[OA_show(120894);// ]]> -->"; > > ScriptElement e = > Document.get().createScriptElement(s); > e.setType("text/javascript"); > e.setLang("javascript"); > > Document.get().getDocumentElement().getChild(2).appendChild(e); > AnchorElement a = > Document.get().createAnchorElement(); > a.setHref("http://d1.openx.org/ck.php?n=766fe8a"); > a.setAttribute("target", "_blank"); > ImageElement i = Document.get().createImageElement(); > i.setSrc("http://d1.openx.org/avw.php? > zoneid=120894&n=766fe8a"); > i.setAttribute("border", "0"); > a.appendChild(i); > > Document.get().getDocumentElement().getChild(2).appendChild(a); > } > > Thanks a lot for your time! > Sigi -- 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-tool...@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.