How to get Firebug to tell me what error jquery's .load() is returning?

Posted by Edward Tanguay on Stack Overflow See other posts from Stack Overflow or by Edward Tanguay
Published on 2010-04-29T05:03:25Z Indexed on 2010/04/29 5:07 UTC
Read the original article Hit count: 373

Filed under:
|
|
|
|

I'm trying to find out what data/error jquery's .load() method is returning in the following code (the #content element is blank so I assume there is some kind of error).

  1. Where do I find in Firebug what content or error .load() is returning?
  2. How can I use console.log to find out at least what content is being returned?

alt text

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script type="text/javascript"
        src="http://www.google.com/jsapi"></script>
        <script type="text/javascript">
            google.load("jquery", "1.3.2");
            google.setOnLoadCallback(function() {
                $('#loadButton').click(loadDataFromExernalWebsite);
            });
            function loadDataFromExernalWebsite() {
                console.log("test");
                $('#content').load('http://www.tanguay.info/web/getdata/index.php?url=http://www.tanguay.info/knowsite/data.txt', function() {
       alert('Load was performed.');
    });
            }
        </script>
    </head>
<body>
    <p>Click the button to load content:</p>
    <p id="content"></p>
    <input id="loadButton" type="button" value="load content"/>
</body>
</html>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about firebug