I have an html file on remote server ,
<!DOCTYPE html>
<html>
<body>
<div > Some content</div>
<script>
function myFunction(){
alert("Hello");
}
</script>
</body>
</html>
And from my main server html page I have to load this page and execute the java script function myFunction()
So I have loaded the page like
<div id="main_id"></div>
<script>
function init(){
var url = "remote.html";
document.getElementById("main_id").innerHTML='<object type="text/html" style="width:100%;height:100%;" data='+url+' ></object>';
}
$(document).ready(init);
</script>
But no idea how I can execute the JavaScript.