hello,
Please someone help me with the below-
As and when I put some html inside a container engaging .html(), it actually loads script tag 2 times.
See the code below-
$("#link").click(function(e){
var css = "<style>body{font-weight:bold;}</style><link rel='stylesheet' type='text/css' href='one.css'>";
var jsdef = "<script src='one.js'><\/script><script src='two.js'><\/script>";
var jsexec = "<script>$('#one').click(function(e){one()});$('#two').click(function(e){two()})<\/script>";
var html = "Hello<br><a id='one' href='#'>click one</a><br><br><a id='two' href='#'>click two</a>";
var response = css+jsdef+html+jsexec;
$("#container").html(response);
return false;
}); Kindly help.
Thanks a lot.
41 weeks 5 days ago