I want to load cross domain url html content on my webpage. I read that it could be achieved by loading url in script and calling global callback function. My code is below-
<html>
<body>
<div id="response"></div>
<script>
function myFunction (data) {
var stringData = JSON.stringify(data)
document.getElementById('response').innerHTML = stringData;
}
</script>
<script src="http://zeenews.india.com?callback=myFunction()"></script>
</body>
</html>
When i run this HTML file, i get below error
Uncaught SyntaxError: Unexpected token <
I could also see this url in front of error
?callback=myFunction():2
Please help me.