Here is the script to load remote content and display in a div
<body>
<script type="text/javascript">
function loadContent(elementSelector, sourceUrl) {
$(""+elementSelector+"").load("http://remote.com/abc.html");
}
</script>
</head>
<body>
<a href="javascript:loadContent('#content', '');">Link 1</a>
<div id="content">content will be loaded here</div>
asfasdfasf
</body>
But it seems there is something security blocking the script about the cross domain ajax, i use xampp as my localhost web server
Error message at chrome console
Origin http://localhost is not allowed by Access-Control-Allow-Origin.
i've searched some solution such as add
<?php header('Access-Control-Allow-Origin: *'); ?>
but not work.
Any fastest way to solve this problem? thanks