안녕하세요, 저는이 test.html 파일의 내용을 ajax로 표시하려고하고 jquery가 index.html에서 경고 기능을 얻습니다. .get이 작동하는 측면의 경보.jquery. 아약스와 함께 작동하지 않습니다.
test.html를
<p>herro my name is dog</p>
index.html을
<!doctype html>
<html>
<head>
<title>Learning jQuery</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<style>
</style>
</head>
<body>
<script>
alert("data");
$.get("test.html", function(data){
alert(data);
});
</script>
</body>
</html>
로컬 파일 시스템뿐만 아니라 웹 서버에서도이 작업을 수행하고 있습니까? – adeneo
예, 웹 서버에서 제대로 서버에 연결되어 있습니다. 두 파일을 모두 편집 할 수 있습니다. – Morpheus
사용중인 URL의 모양과 브라우저는 무엇입니까? – nothingisnecessary