jQuery issue?!?

Status
Not open for further replies.

ziycon

New Member
This is the error I'm getting when the page loads but I can't figure out what is going on? Anyone tell me what the error means?
Error: uncaught exception: Syntax error, unrecognized expression: Syntax error, unrecognized expression: serverExtra
The source code can be viewed at www[dot]ign[dot]ie
 

php.allstar

New Member
Hi first of all I'd change

HTML:
<span id="serverExtra"><script language="Javascript"

to...

HTML:
<span id="serverExtra"><script type="text/javascript"

I can also see that you have used "$" as your jQuery handle yet you haven't defined a jquery ready event...

HTML:
<script type="text/javascript">
    $(function() {

        // Your jquery code in here...

    });
</script>

add the ready event somewhere after jquery has been included. Try that and let me know how you get on
 

php.allstar

New Member
Sorry just saw this now...

HTML:
<body onload="$('span:serverExtra').hide();">

You'll need to take that jquery call out of there and add it into the jquery ready event...

HTML:
<script type="text/javascript">
    $(function() {
        
        $("#serverExtra").hide();

        $("#hide").click(function () {

            $("#serverExtra").hide("slow");

        });

        $("#show").click(function () {
	
            $("#serverExtra").show("slow");

        });

    });
</script>
 

ziycon

New Member
Thanks for those tips, I thought that the ready event is defined in the jquery.js file? This code works fine locally.
 
Status
Not open for further replies.
Top