Load another page with DOM changing
I'm trying to load from
initial.html different html page with:
- $("#hidden_demo_div").load("modules/another.html", function (data) {
var value = $(data).filter("#demo_div");
var html = value.html(); // THERE IS NO <strong>Hello</strong> here!!!
}
(The "#hidden_demo_div" is at the initial.html (HTML where JS code with .load is linked). This element is declared at the BODY)
here a snippet from another.html
- <html>
.........................
<head>
<script type="text/javascript">
$(document).ready(function() {
anotherMethodInvocation();
});
</script>
</head>
<body>
<div id="demo_div"></div>
</body>
</html>
next at JS for another.html I have:
- function anotherMethodInvocation() {
$("#demo_div").append("<strong>Hello</strong>");
}
So the question is why am I getting (in my callback function at load) just static HTML but not it changes?