Lets say I have a string like this
var methodString = "<script>
var a;
var b;
function func1(v1, v2)
{
..///DO random stuff
}
</script>";
I then attach this code to the end of the body after a button click somewhere on the page
$(body).append(methodString);
How do I call this new function that i just appended
$("button1").click(function() { func1(a,b); }); //This doesn't seem to recognize the new method.
simple HTML
With jQuery