You will save a lot of time if you use something that is done already, and tested, like the links provided by Frank. If you still want to try it yourself you can check "Bind.js" :

http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js?view=markup

musachy

Frank W. Zammetti wrote:
Hi Adam,

If your doing straight AJAX yourself, i.e., directly interacting with the
XMLHttpRequest object, this won't execute script for you automatically. In fact, it won't do much of anything for you automatially, aside from
parsing XML if that's your return type.  Otherwise, it's just text to the
object and you'll have to execute scripts yourself.

Another poster gave you some info if your using S2, but I'm guessing by
your description your using S1.  In that case, continue reading! :)

The AjaxParts Taglib (APT) in Java Web Parts (JWP) takes care of this for
you... you can certainly switch over to using APT, but if you just want
some code to execute scripts, take a look here:

http://javawebparts.cvs.sourceforge.net/javawebparts/javawebparts/WEB-INF/src/javawebparts/ajaxparts/taglib/resources/AjaxPartsTaglib.js?view=markup

Down around line 313 you'll find the execScripts() function... simply yank
that out and use it on the responseText from XMLHttpRequest and you'll be
good to go.

If you are interested in looking at APT, here's a link:

http://javawebparts.sourceforge.net/javadocs/javawebparts/ajaxparts/taglib/package-summary.html

And for JWP in general:

http://javawebparts.sourceforge.net

Hth,
Frank




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to