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

html文件双击可正常使用,放到服务器上就不运行,请解决!
HTML code
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7" />

</head>
<body>

<link href="css/layout.css" rel="stylesheet" />
<script src="js/jquery.js"></script>
<script src="js/layout.js"></script>
<script src="js/head_zone_arr.js"></script>
<script src="js/jquery.include.js"></script>
<script type="text/javascript">
 var basePath = 'http://192.168.1.120/';
  $(function(){

              if(document.getElementById('scrollCity')){

                  $.include("js/city_zone.js");

                  $.ajax({type:"post",url:"cityListJosn.html",dataType:"text",success:function(data){ $("#level_0").html(data); $("#leaveCity").bind("mouseover",function(){ openCity(); });}});      

              }

      })

function openCity(){

    jQuery('#cityList').show();
    jQuery('.click-but right bg-nav b').removeClass("Slist-up");
    jQuery('.click-but right bg-nav b').addClass("Slist-dowm");
}
function closeCity(){
    jQuery('#cityList').hide();
    jQuery('.click-but right bg-nav b').removeClass("Slist-dowm");
    jQuery('.click-but right bg-nav b').addClass("Slist-up");
}
</script>
<aside id="city">
  <div class="city-center">
    <ul class="city-right left" id="scrollCity">
    </ul>
    <ul class="city-left left hover" id="leaveCity" onMouseOut="var leave = document.getElementById('leaveCity'); if (isMouseLeaveOrEnter(event, this)) closeCity();" >
      <li class="click-but right bg-nav" style="cursor: pointer"><mark>区域代购中心分布</mark><b class="Slist-up"></b></li>
      <li class="races left" style="display:none;" id="cityList">
          <div class="mmap">
              <div class="city-ad">
                  <dl id="level_0"></dl>
              </div>
              <dl id="area_level_1" style="display:none; float:right">
                  <dd style="float:right;">
                      <div class="city-mouse-s"  id="level_1"></div>
                  </dd>
              </dl>
          </div>
      </li>
    </ul>
  </div>
</aside>
</body>
</html>


------解决方案--------------------
看你服务器配置html支持post请求没有,一般静态文件是不支持post请求的。

改你的请求为get
 $.ajax({type:"GET",url:"cityListJosn.html",dataType:"text",success:function(data){ $("#level_0").html(data); $("#leaveCity").bind("mouseover",function(){ openCity(); });}});


你的问题和这个差不多
jquery easyui datagrid数据源为json文件问题