Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Dec 2010
    Location
    Kent, UK
    Posts
    573
    Thanks
    23
    Thanked 10 Times in 10 Posts

    how to add error message to this function

    hi guys, im not very good with javascript/jquery, i have the following code:

    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:

    Code:
    <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
    Last edited by Dan13071992; 01-06-2012 at 08:38 PM.
    http://360-tactics.co.uk/forum/index.php

    Crime-Wave

    please post your code wrapped in tags
    please post your PHP wrapped in tags

  • #2
    Regular Coder
    Join Date
    Dec 2010
    Location
    Kent, UK
    Posts
    573
    Thanks
    23
    Thanked 10 Times in 10 Posts
    bump please help
    http://360-tactics.co.uk/forum/index.php

    Crime-Wave

    please post your code wrapped in tags
    please post your PHP wrapped in tags


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •