I am wondering how i can change this jQuery Ajax script so it doesn’t change the div content if the Ajax returns nothing? I’m pretty new to jQuery & JavaScript sorry. Thanks 🙂
Source code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
var auto_refresh = setInterval(
function ()
{
$('#load_tweets').load('record_count.php').fadeIn("slow");
}, 10000); // refresh every 10000 milliseconds
<body>
<div id="load_tweets"> </div>
</body>
</script>
Instead of using the
.load()function:Try
$.ajax():