PiTiLeZarD
unread,Jan 25, 2011, 9:51:26 AM1/25/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to boxy
Hi,
I just pointed out an issue while using javascript inside the return
of an ajax query. The javascript was executed before the display was
done, so I propose a patch that works for me :
(the patch basically launch javascripts after the boxy alert is
displayed, this way all DOM is updated and fully usable)
--- a/public/js/jquery.boxy.js Tue Jan 25 12:32:20 2011 +0100
+++ b/public/js/jquery.boxy.js Tue Jan 25 15:44:28 2011 +0100
@@ -149,7 +149,14 @@
url: url, type: 'GET', dataType: 'html', cache: false,
success: function(html) {
html = jQuery(html);
if (options.filter) html = jQuery(options.filter,
html);
- new Boxy(html, options);
+
+ /* display only html */
+ new Boxy(html[0], options);
+
+ /* execute all scripts afterwards */
+ for (var i = 1; i < html.length; i++) {
+ $.globalEval($(html[i]).html());
+ }
}
};