div가 있지만 액세스 제어 허용 원점 문제에 새 페이지를 표시하고 싶습니다.요청한 리소스에 Access-Control-Allow-Origin '헤더가 있습니다.
예를 들어, 나는 ==============================
를 표시 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>
코드를 게시하고 화면을 캡처하지 마십시오. –