.load() 함수를 사용했습니다. Dreamweaver의 라이브보기에서는 작동하지만 Firefox, Chrome 또는 IE에서는 작동하지 않습니다.jQuery로드는 Dreamweaver에서 작동하지만 브라우저에서는 작동하지 않습니다.
<script src="js/jquery.js"></script>
<script src="tabsPull.js"></script>
<h1>Homework Assignments</h1>
<ul id="button-menu">
<li id="a1"><input class="no" type="button" onClick="ChangeActive(1)" value="Mon"></li>
<li id="a2"><input class="no" type="button" onClick="ChangeActive(2)" value="Tues/Wed"></li>
<li id="a3"><input c lass="no" type="button" onClick="ChangeActive(3)" value="Thurs/Fri"></li>
</ul>
<div id="tabInner" class="tabInner">
</div>
ChangeActive() 별도의 JS 파일 (tabsPull.js)에 :
var active = 0
function ChangeActive(active){
if (active==1) {
document.getElementById("a1").className = "active";
document.getElementById("a2").className = "";
document.getElementById("a3").className = "";
$('#tabInner').load('http://axoplanner.weebly.com/monday.html #content');
} else if (active==2) {
document.getElementById("a2").className = "active";
document.getElementById("a1").className = "";
document.getElementById("a3").className = "";
$('#tabInner').load('http://axoplanner.weebly.com/tuesdaywednesday.html #content');
} else if (active==3) {
document.getElementById("a3").className = "active";
document.getElementById("a1").className = "";
document.getElementById("a2").className = "";
$('#tabInner').load('http://axoplanner.weebly.com/thursdayfriday.html #content');
}
}
문제가 무엇입니까 여기
내 HTML 부분입니까? DW에서 작동하지만 브라우저가 아닌 이유는 무엇입니까 ??? Weebly에서 물건을 가져 오는 이유는 다른 사람들이 그것을 업데이트해야하기 때문입니다. Weebly가 더 쉽습니다.
브라우저에서 오류 콘솔을 보면 검색 엔진에 연결하여 동일한 원본 정책을 위반하고 있음을 알리는 오류 메시지가 표시됩니다. 기본적인 디버깅 (오류 메시지를 보는 첫 번째 단계)을 수행해야하며 "작동하지 않습니다."라고보고하지 않아야합니다. – Quentin
@Quentin 상대적인 오류가 없으면 버튼을 클릭합니다. _ [16 : 21 : 48.508] GET http://axoplanner.weebly.com/monday.html [HTTP/1.1 200 OK 182ms ] _ –
@Quentin _ 동일 원산지 정책이란 무엇입니까? –