日期:2014-05-16  浏览次数:20355 次

为什么这段代码可以在ie运行但是在谷歌上没反应


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>


<script type="text/javascript" src="jquery-1.11.0.min.js"></script>



<script type="text/javascript" >

$(function(){

 



/****load***/
 $('#button2').click(function(){
 $.getJSON("UserInfo.json" , function(data){
 $('#divTip').empty();
 var str="";
 $.each(data ,function(InfoIndex,Info){
 str += "name:"+Info["name"];
 str += "sex:"+Info["sex"];
 str += "<hr />";
 })//end  each
 $('#divTip').html(str);
 })//end  get json
 })//end  click
/****end***/

})

</script>


</head>

<body>


         <input type="button" id='button2' value="load" />
         <div id='divTip'></div>

</body>
</html>



------解决方案--------------------
 谷歌不通过服务器,不能加载 json文件 。