Subject: | "Executing javascript - CGI::Ajax 0.707, w/patch" |
Date: | Wed, 03 Feb 2010 21:00:15 +0300 |
To: | bug-CGI-Ajax [...] rt.cpan.org |
From: | Anton Soldatov <pinnsvin [...] mail.ru> |
Hello all,
Actually, this is not a new bug (see https://rt.cpan.org/Public/Bug/Display.html?id=25495), but the fix for the latest version seems to be different from the one proposed by Ryan Gralinski.
To enable executing javascript code from Ajax responses, apply the following patch:
*** Ajax-orig.pm 2008-10-08 22:13:34.000000000 +0400
--- Ajax.pm 2010-02-03 20:44:30.676908029 +0300
***************
*** 957,962 ****
--- 957,964 ----
} else {
div.innerHTML = data[i];
}
+ var jscode = div.getElementsByTagName("script");
+ for(var j = 0; j < jscode.length; j++) eval(jscode[j].innerHTML);
}
} else if (typeof(dt[0])=='function') {
dt[0].apply(this,data);
Best regards,
Anton Soldatov