calling a javascript function after Updating the div
I have an div tag like this
I am updating the div as shown below using prototype
$('dateRange').update(dateData[开发者_开发技巧xmin] + ' - ' + dateData[xmax]);
My question is after Updating the div , is it possibe to call a function ??
I have search div event handlers , but nothing is working .
could anybody please help .
I tend to use this function:
$.fn.andThen = function(callback) { callback.call(this); return this; }
So you would do:
$('dateRange').update(dateData[xmin] + ' - ' + dateData[xmax]).andThen(function() { alert("Updated"); });
Although I'd just call the function after I've updated the div, unless you're doing some $.ajax
call or something asynchronous.
Call it right after your update statement. it's not asynchronous I assume.
精彩评论