ajax 读取本地文件,jquery读取本地文件

$(document).ready(function(){

$("#b01").click(function(){

htmlobj=$.ajax({url:"/jquery/test1.txt",async:false});

var temp=htmlobj.responseText; alert(temp);

$("#myDiv").html(htmlobj.responseText);   });

});

 

 


$("#one a").css("cursor", "pointer").click(function () {
$.post("course/popular/content1.html",null,function(data){
alert(data);//这里data为content1.html文件里的内容
});
});

posted @ 2021-08-31 10:36  zxh91989  阅读(717)  评论(0编辑  收藏  举报