views:

489

answers:

1

I am trying to learn javascript/jquery, using firebug to debug and have built a page, which I have reduced to a minimal below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head>

<script src="jquery-1.3.2.js" type="text/javascript"></script>
<script language="JavaScript" "text/javascript">

function geoAddress() {
    alert("start");
    var postcode = $("#PostCode").val();

    }
</script>
<title>Postcode</title>
</head>
<body>
<div class="page">
<h2>Create</h2>

<form action="/Venues/Create" method="post">
        <fieldset>
            <p>
                <label for="PostCode">Postcode:</label>
                <input id="PostCode" name="PostCode" type="text" value="" />
                <input type="button" onclick="geoAddress();"/>   
            </p>
        </fieldset>
    </form>
</div>

</body>
</html>

I believe that this worked previously, but now although it does work (i.e. I press the button and get an alert) in firebug, on first loading I see a javascript error.

I have jquery-1.3.2.js loaded in the same directory as my file.

I seem to be struggling with firebug so would appreciate pointing in the direction of tutorials for the current version for javascript debugging. I can't even see a way to view the whole error message.

I would appreciate any help with what this error is and also pointers in the right direction for using firebug.

A: 

1st step - Can you make sure jQuery is being requested successfully. In firebug click the Net tab and it will show you all requests that are made and the failed ones will appear in red.

redsquare
OK, I had to enable the net tab, but after doing that (and restarting firefox too) I get nothing other than: http://img.skitch.com/20090701-x779jwe6g1q3yswpfw664nepq8.jpg.
Richbits
redsquare
I get the same result. It flicks to the script tab when the error comes up. I do seem to get similar error for stackoverflow now though. I'll try on another machine tomorrow and report what happens there.
Richbits
redsquare
yes, I'll try all that, and report back..Thanks.
Richbits
Think that had a problem with firefox or firebug or both, I've created a new profile and reinstalled firebug, and it all works fine now. Thanks for your help.
Richbits
no worries, glad its sorted
redsquare