...

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



Dan13071992
01-06-2012, 07: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>
<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 });
});
</script>


it basically updates the div tag:



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


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

Dan13071992
01-11-2012, 03:01 PM
bump :) please help



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum