2016-07-25 22 views
0

PHPバージョン7.0JQuery/Javascriptでdivを正しく読み込めませんか?

jQueryのバージョン3.1.0

あなたは上記のコードすべてが単純にコピーされ、さわやかなのではなく、5秒ごとに貼り付けられていることがわかります。

5秒ごとにインクルードをリフレッシュすることを意図しています。

ウェブサイト:http://ssmsportal.cf/pages/incomingCalls.php

コード:

<!doctype html> 
<html><head> 
     <meta charset="utf-8"> 
     <title>ServerSide Moderation Services</title> 
     <link rel="stylesheet" href="../styles/tablesStyles.css" type="text/css" /> 
     <link rel="stylesheet" href="../styles/incomingCallsStyle.css" type="text/css" /> 
     <script src="//ajax.googleapis.com/ajax/libs/dojo/1.11.2/dojo/dojo.js"></script> 
     <script src="../scripts/general.js" type="text/javascript"></script> 
     <meta name="viewport" content="width=device-width, initial-scale=1.0"/> 


    <title>Whats Up?</title> 

    </head> 
    <body class="body"> 
     <?php include '../includes/header.php'; ?> 
     <div class="mainContent"> 
      <div class="logRegArea"> 
       <article class="callsContent" style='padding-left: 0px; padding-right: 0px;'> 
        <header> 
         <h2 class="loginArea" style="text-align:center">Incoming Calls:</h2> 
        </header> 
        <content> 
         <div id="login"> 
         <?php include '../includes/incomingCalls.php'; ?> 
         </div> 
         <script src="../scripts/jquery.js" type="text/javascript"></script> 
         <script type="text/javascript"> 
          $(document).ready(function() { 
           setInterval(function() { 
            $('#login').load('../includes/incomingCalls.php') 
           }, 5000); 
          }); 
         </script> 
        </content> 
       </article> 
      </div> 
     </div> 
     <footer class="mainFooter"> 
      <p>This website was developed by ROBLOX user: <a href="https://www.roblox.com/users/8869935/profile" title="Made by: wattleman">wattleman</a></p> 
     </footer> 
    </body> 
</html> 
+0

私は$(文書)を押し置き換えることができることを前提と問題 –

答えて

1

ロード機能の正常な動作です。

代わりに試してみてください:

$.get("../includes/incomingCalls.php", function(data) { 
    $("#login").html(data); 
}); 
+0

は何ですか?もし私は何を置き換えるのですか?タイマーはどこに行きますか、それとも生きていますか? – Austin

+0

あなたはこれのロード機能を変更するだけです。タイマーや文書の準備など、残りの部分は保管しておきます。 –

+0

このように? https://gyazo.com/190a88a3fcb987b792b2aea87c651219 – Austin

関連する問題