Platinum Partner

How To Parse And Evaluate JavaScript In GWT

If you have a service that returns JavaScript (e.g. for Google Analytics), the following code should do the trick. You can call it using something like:


    evalScripts(new HTML(response.getText()).getElement())


    /**
     * Evaluate scripts in an HTML string. Will eval both 
     * and 

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}