I want to display a new page in the div but access-control-allow-origin issues.
for example, I try to display www.naver.com
========================================================================
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script src="js/jquery.ajax-cross-origin.min.js"></script>
<script>
$(document).ready(function() {
var url = 'http://www.naver.com';
jQuery.ajax({
type:"GET",
url : url,
dataType:"jsonp",
crossOrigin: true,
success : function(data) {
console.log('success');
console.log('success:'+url);
},
error : function(data) {
console.log('error');
}
});
$('#openPage').load(url);
});
</script>
<style>
#btn{
width: 100%;
height:50px;
}
</style>
</head>
<body>
<!-- <div id="btn">
<button>button</button>
</div> -->
<div id='openPage'></div>
</html>