I am using localtime.js sucessfully on my app but now that ive started to use ajax
the elements created with ajax does not have the formatting that the plugin localtime does for me on my normal non ajax elements.
here’s the local time plugin in im using
http://code.google.com/p/jquery-localtime/downloads/detail?name=jquery.localtime-0.5.js&can=2&q=
how can i re trigger it for the new elements that ajax created?
I am using localtime.js sucessfully on my app but now that ive started to
Share
I’m guessing your localtime plugin is listening for DOM readiness event like
$(document).ready()to apply its formatting to the appropriate elements during the initial page load. Unless there is a similar link from your ajax success callback, in which new DOM content is inject, to those formatting functions, those functions will not be triggered and the desired formatting will not occur. In order to select and format elements added after the initial page load, you’ll probably need to call your localtime formatting functions after you inject elements from your ajax call. This may involve enclosing your formatting process in a named function, which you would call once during initial page load, and again each time relevant content is injected.If you were to show us your code, you could probably expect a more detailed and direct response.