다음 스크립트는 내 웹 페이지에 업로드 할 때 작동하지 않습니다. 그것은 잘 작동하고 w3school.com에서 'TryIt Editor'에서 시도해 보면 url을로드합니다. 이 예에서 도메인 이름을 변경했습니다.내 웹 사이트에서 Java 스크립트가 작동하지 않습니다.
<!DOCTYPE html>
<html>
<body>
<script type='text/javascript'>
var x=1;
function changeLink()
{
x=x+1;
var y="http://example.com/basicone/image"+x+".html";
document.getElementById('iframe-a').src=y;
}
</script>
<iframe id="iframe-a" seamless src="http://example.com/basicone/image1.html" height="450" width="1000" scrolling="no"></iframe>
<button id="button" onclick="changeLink()">Next</button>
</body>
</html>
당신이 어떤 오류를받을 수 있나요? 콘솔에서 아무 말도하지 않니? – BeNdErR
오류 없음, 버튼을 클릭해도 아무런 변화가 없습니다 –
버튼에'type = "button"''을 추가해야합니다. 그렇지 않으면 특정 브라우저에서'submit'로 작동합니다. – Jonathan