View Full Version : how to add error message to this function

01-06-2012, 08:35 PM
hi guys, im not very good with javascript/jquery, i have the following code:

<script src="http://code.jquery.com/jquery-latest.js"></script>
$(window).ready(function() {
$("#responsecontainer").load("includes/inc-mess-jail.php", function(response, status, xhr) {

var refreshId = setInterval(function() {
$("#responsecontainer").load('includes/inc-mess-jail.php?randval='+ Math.random());
}, 9000);
$.ajaxSetup({ cache: false });

it basically updates the div tag:

<td colspan="2">
<div id="responsecontainer" align="center"></div>

i wanted to add an error message to it, that comes up underneath the <div id="responsecontainer" align="center"></div> that says "Error" with an id number next to it, then when your mouse goes over it a box comes out saying "there was a problem retrieving your information. the game will continue trying to resolve this" and then underneath where it says error i would like it to say the number of attempts it has tried to recollect the information.

obviously i would only like this error message to come up, when it cannot refresh the information.

Any help would be great, even pointing me in the right direction

01-11-2012, 04:01 PM
bump :) please help