ScriptElement.setInnerText doesn't take effect

49 views
Skip to first unread message

David

unread,
Apr 14, 2017, 1:26:56 AM4/14/17
to GWT Users
I use GWT to process <script/>, change its contents and set new content through ScriptElement.setInnerText() method. But new change doesn't take effect. I don't know why. Please help me out.

Thanks,

David.

Alberto Mancini

unread,
Apr 14, 2017, 2:50:58 AM4/14/17
to google-we...@googlegroups.com
Hello,
AFAICT there's a chance that you have to use .setText instead of .setInnerText. 

That said, can i ask you what is the purpose of modifying the script content of a script tag ?

Regards,  
  Alberto


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

Vassilis Virvilis

unread,
Apr 14, 2017, 6:47:18 AM4/14/17
to google-we...@googlegroups.com
Does this work across browsers? What happens on the previous code?

I always thougt that the current best practice was 'page reload'.


On Apr 14, 2017 09:50, "Alberto Mancini" <ab.ma...@gmail.com> wrote:
Hello,
AFAICT there's a chance that you have to use .setText instead of .setInnerText. 

That said, can i ask you what is the purpose of modifying the script content of a script tag ?

Regards,  
  Alberto


On Fri, Apr 14, 2017 at 7:27 AM David <leeo...@gmail.com> wrote:
I use GWT to process <script/>, change its contents and set new content through ScriptElement.setInnerText() method. But new change doesn't take effect. I don't know why. Please help me out.

Thanks,

David.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.

David

unread,
Apr 14, 2017, 8:57:31 AM4/14/17
to GWT Users
Original web site only runs in IE8. I have to convert document.all tag for Chrome or IOS on fly. I can not get access to source codes and I need to keep all functions by replacing IE8-related tags so I need any change in ScriptElement can take effect immediately.

David


On Friday, April 14, 2017 at 6:47:18 AM UTC-4, Vassilis Virvilis wrote:
Does this work across browsers? What happens on the previous code?

I always thougt that the current best practice was 'page reload'.

On Apr 14, 2017 09:50, "Alberto Mancini" <ab.ma...@gmail.com> wrote:
Hello,
AFAICT there's a chance that you have to use .setText instead of .setInnerText. 

That said, can i ask you what is the purpose of modifying the script content of a script tag ?

Regards,  
  Alberto


On Fri, Apr 14, 2017 at 7:27 AM David <leeo...@gmail.com> wrote:
I use GWT to process <script/>, change its contents and set new content through ScriptElement.setInnerText() method. But new change doesn't take effect. I don't know why. Please help me out.

Thanks,

David.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.

Jens

unread,
Apr 14, 2017, 5:14:00 PM4/14/17
to GWT Users
If it is inline script (no src attribute) then I think that is not possible with JavaScript and thus not possible with GWT. Inline JavaScript is executed immediately / synchronous during page load. I think won't execute again when you change it using innerHTML.

I guess you would need to use a proxy server that modifies the files before you send it to the browser.

-- J.
Reply all
Reply to author
Forward
0 new messages