Austin Austin - 1 year ago 34
PHP Question

JQuery/Javascript not properly loading a div?

PHP Version 7.0

JQuery Version 3.1.0

You can see that the everything above the code is simply copied and pasted every five seconds rather than refreshing.

The intention is to refresh the include every five seconds.



<!doctype html>
<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="//"></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>

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

Answer Source

That's the normal behavior of the load function.

You should instead try:

$.get("../includes/incomingCalls.php", function(data) {