Sunday, September 22, 2013

Re: How-to display a Javascript-Widget (e.g. from tripadvisor) in an GWT HTML Widget?



On Saturday, September 21, 2013 1:34:27 PM UTC+2, marian lux wrote:
I found something about "Script Injection" and tried the following code to add the script in my HTML page (on EntryPoint - method):

        Document doc = Document.get();
        ScriptElement script = doc.createScriptElement();
        script.setSrc("http://www.jscache.com/wejs?wtype=cdswritereviewlg&uniq=303&locationId=206597&lang=en_AU&border=true");
        script.setType("text/javascript");
        script.setLang("javascript");
        doc.getBody().appendChild(script);

It's a bit easier with GWT's ScriptInjector (just don't forget setWindow(TOP_WINDOW)).

and added the other code as String in an HTML-Widget.
But there is the same issue. Only the text:
"Review Grand Hotel Wien"
appears!

That script uses document.write() so it cannot be script-inserted. Try injecting the script it document.write()s though, it looks like it should be OK (just wouldn't benefit from "jscache.com", whatever it is)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment