[jQuery] styleswitcher problem 2 (aka "$ is not a function")
<html>
<body>
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
<blockquote type=cite class=cite cite="">Date: Mon, 28 Jan 2008 22:26:03
+1300
To: jquery-en@googlegroups.com
From: Bruce MacKay <b.mackay@massey.ac.nz>
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.
<tt><x-tab> </x-tab>
$('.styleswitch').bind('click',function()
<x-tab> </x-tab>{
<x-tab> </x-tab><x-tab>
</x-tab>
switchStylestyle(this.getAttribute('rel'));
<x-tab> </x-tab><x-tab>
</x-tab>return
false;
<x-tab> </x-tab>});
<x-tab> </x-tab>var c =
readCookie('style');
<x-tab> </x-tab>if (c)
switchStylestyle(c);
</tt>[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 </blockquote></body>
</html>