im using jQuery load() method to send another html to my webpage. The html being loaded contains Javascript generated HTML.
Im using this function to load the html:
$(document).ready(function(){
$("img#links").click(function(){
$("div#content").load("links.html");
});
});
The links.html contains:
<h1 id="content">Links</h1>
<br>
<script>add_link("http://google.com");</script>
The add_link function generates me a table:
var add_link = function(link) {
document.write("<table border=\"0\" width=\"100%\" height=\"50\" id=\"link\">");
document.write("<tr>");
document.write("<td width=\"50\"><img src=\"img/star.png\" /></td>");
document.write("<td><a href=\"" + link + "\"><div class=\"link\">" + link + "</div></a></td></tr></table>");
}
However, when called instead of writing that js generated code into the webpage, it gets written to a blank page, containing only the table generated by JS.