2017-01-18 41 views
0

由于我在我的网络服务器上使用https,带有div自动刷新功能的AJAX不起作用。当我使用HTTP时,一切正常。有人能帮我吗?AJAX在https上不起作用

下面是我使用的代码:

<b> 
    <div id="showMessages"> 
     <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> 
      function autoRefresh_div() { 
       $("#showMessages").load("showMessages.php"); // a function which will load data from other file after x seconds 
       alert("Auto-Refresh works fine"); 
      } 

      setInterval('autoRefresh_div()', 5000); // refresh div after 5 secs 
     </script> 
     <?php include("showMessages.php"); ?> 
    </div> 
</b><br> 

股利也是可用的。感谢大家

+0

我不明白这是如何工作的任何地方因为你已经把你的JS代码在'script'标签用'SRC '属性。您需要使用两个单独的'