Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Stu Cowley
26,287 PointsStrange jQuery Unrecognized Expression (Syntax error, unrecognized expression: .)
So I have a really weird bug in jQuery 1.11.1 (Compressed).
I have a collapsing div and when I load the page page I am developing on my Mac the I can get this to work perfectly. Thinking the page was ready to be finalised I did a test on good old Windows and it was not working.
I had a look at the console to see why this isn't working and I was presented with the following error"
Uncaught Error: Syntax error, unrecognized expression: . jquery.js:2
So I decided I would look further into what was happening with this error and this is what the console output also displayed upon further inspection.
fb.error jquery.js:2
fb.tokenize jquery.js:2
fb.select jquery.js:2
fb jquery.js:2
m.fn.extend.find jquery.js:2
m.fn.init jquery.js:2
m jquery.js:2
I'm not 100% is there is an issue with this particular version of jQuery or if it is something I am doing.
Here is the code for my collapsing dive.
$('.').click(function(){
$('.round-details')
});
Any help will be greatly appreciated as this issue is a bit beyond my abilities with jQuery as I am still only learning.
Thanks
Stu :)
1 Answer
Calvin Nix
43,828 PointsHey Stu,
I believe that your issue lies within the first line.
What element are you trying to point to using $(.)?