On Tuesday, February 15, 2011 10:27:16 AM UTC+1, asianCoolz wrote:
>
> let say i have short javascript snippet inside uibinder.ui.xml file.


Beware that it's likely to break sooner than later:

Note: When inserted using the document.write() method, script elements 
execute (typically synchronously), but when inserted using innerHTML and 
outerHTML attributes, they do not execute at all.

— Source: http://dev.w3.org/html5/spec/scripting-1.html#dom-script-text
 

>
> and i want to use i18n. how to pass the ui:msg into javascript? 
> <script> 
>
>
> <uibinder..> 
>   <html> 
>     <ui:msg key='something'>.. </ui:msg> 
>
> <script> 
>    var messageis =  how to pass the ui:msg into here 
> </script>


The <script> is just some HTML markup, no different from a <div> (from the 
point of view of UiBinder), so it shouldn't be any different from using 
<ui:msg> elsewhere (except that you'd have to give particular attention to 
quotes, apostrophes, backslashes and line feeds, as they could easily break 
your script).

Or are you talking about accessing some <ui:msg> that has been used 
elsewhere in the ui.xml file? if so, then wrap the <ui:msg> within a <span> 
so you can later refer to the span's innerHTML.
 

-- 
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