<div dir="ltr">At runtime, our widgets are rendered using Javascript. It would help tremendously if we could execute the same script in VPE so I don&#39;t have to reinvent the wheel in Java.... (though calling into JS using Rhino is another option, but I&#39;m guessing nowhere near as effecient)<br>
<br><div class="gmail_quote">On Fri, Aug 15, 2008 at 6:33 PM, Max Andersen <span dir="ltr">&lt;<a href="mailto:manderse@redhat.com">manderse@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
We do what we can to prevent javascript to execute in the editor to avoid bad sidesffects -. Why do you need it ?<br>
<br>
/max (sent from my phone)<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
On 15/08/2008, at 21.25, &quot;Marshall Culpepper&quot; &lt;<a href="mailto:mculpepper@appcelerator.org" target="_blank">mculpepper@appcelerator.org</a>&gt; wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
Hey guys..<br>
<br>
I was curious if it&#39;s possible to execute javascript by adding &lt;script&gt; nodes into the head node the same way that &lt;link&gt; nodes are added for CSS styles. I&#39;ve created a method that does it for me locally, but the script in question doesn&#39;t seem to be executing... is there something special needed to make javascript work in this document? Here&#39;s my snippet:<br>

<br>
public static void addScriptNodeToHead (VpePageContext pageContext, nsIDOMDocument visualDocument, String scriptSrc) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp;nsIDOMNode headNode = &nbsp;pageContext.getVisualBuilder().getHeadNode();<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;nsIDOMElement scriptNode = visualDocument.createElement(&quot;script&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;scriptNode.setAttribute(&quot;src&quot;, scriptSrc);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;scriptNode.setAttribute(&quot;type&quot;, &quot;text/javascript&quot;);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;headNode.appendChild(scriptNode);<br>
 &nbsp; &nbsp;}<br></div></div>
_______________________________________________<br>
jbosstools-dev mailing list<br>
<a href="mailto:jbosstools-dev@lists.jboss.org" target="_blank">jbosstools-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/jbosstools-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/jbosstools-dev</a><br>
</blockquote>
</blockquote></div><br></div>