I’m using a jQuery plugin, it gets data from an url, fetches, calculates and writes some data in a div.
I want to copy this div contents to another div, when that functions do its work.
for example:
$("#div1").myfunction(); // it gets and calculates data and adds to #div1 . it needs 2-3 seconds to be done
var contents = $("#div1").html(); // when myfunction() done, copy contents
$("#div2").html(contents);
when i ran that code, i didn’t have new contents in #div2.
you need to have
myfunctiontake a callback parameter which it executes once the request is done