Hi folks,

What I neglected to point out in my first post is that I know jquery is being loaded as other function calls (e.g. Shadowbox.init();) appearing earlier in the document.ready block are being fired. I can also see the file loaded when I view - through Firebug - the javascript files loaded into the page

However, further testing has revealed that it is not styleswitcher that is at fault here. If I make
$("a.link1").bind("click", function() {getFirstPage(this.id)});
the first line in the block with the $ element, I generate the same error message - "$ is not a function"

Cheers

Bruce


Date: Mon, 28 Jan 2008 22:26:03 +1300
To: jquery-en@googlegroups.com
From: Bruce MacKay <[EMAIL PROTECTED]>
Subject: styleswitcher problem

Hello folks,

I've just belatedly upgraded to the latest version of jQuery and am finding old plugins now misbehaving.

I'm having trouble with Kevin Luck's styleswitch.

FIrebug is reporting "$ is not a function" on the first line of this code. I can't understand it - jquery is already loaded.

        $('.styleswitch').bind('click',function()
        {
                switchStylestyle(this.getAttribute('rel'));
                return false;
        });
        var c = readCookie('style');
        if (c) switchStylestyle(c);

[Actually, the first line in Kevin's code is
$('.styleswitch').click(function()

but I have a recollection that .bind('click',...) is now the preferred format.]

Can anyone help me here please (or point me at another stylesheet switching approach).

Thanks


Bruce

Reply via email to