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
.
The work function is the minimum energy required to take out one electron through the surface. It can be measured by analyzing the slowest electrons emitted from the substrate applied with excess energy.
The photoelectric work function is the minimum photon energy required to liberate an electron from a substance, in the photoelectric effect. If the photon's energy is greater than the substance's work function, photoelectric emission occurs and the electron is liberated from the surface.
Heat and work are forms of energy that are in motion. They exist only when there is a change in the state of system and surroundings. In other words, they are non-existent before and after the change of state. Therefore, the work done is a path function.
you need to have myfunction
take a callback parameter which it executes once the request is done
function myfunction(cb)
$.ajax({
type: "get",
url: "page.html",
success: function(data){
$("#div1").html(data);
if(typeof cb === 'function') cb();
}
});
}
myfunction(function(){
$("#div2").html($("#div1").html());
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With