초보자를 jquery로 완성 했으므로 w3schoolsexample을 복사하고 같은 디렉토리에 텍스트 파일을로드하려고 시도하지 않았습니다.jquery 초보자가 텍스트 파일을로드 할 수 없습니다.
은 내가 jqueryTest.html 파일이
demo_test.txt 파일은 하나 개의 단어testing
입니다
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#div1").load("demo_test.txt");
});
</script>
</head>
<body>
<div id="div1"></div>
</body>
</html>
내가 HTML 파일을 실행하면 그냥 빈 페이지를
분명히 얻을 간단한 오류가 있지만 도움을 주시면 감사하겠습니다.
프로그래밍 학습을 위해 W3 학교를 사용하지 마십시오. 못. –
demo_test.txt는 웹 사이트의 루트에 있습니까? 또한 웹 서버 또는 파일을 가리키는 브라우저에서만이 작업을 실행하고 있습니까? –
JQuery URL 앞에'http : //'를 추가하십시오. – sdespont