Jquery Syntax Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack uncaught error syntax error unrecognized expression jquery href Overflow the company Business Learn more about hiring developers or posting ads with us wordpress uncaught error: syntax error, unrecognized expression: a[href*=#]:not([href=#]) Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community
Jquery Syntax Error Unrecognized Expression Url
of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up jQuery Syntax Error up vote -2 down vote favorite $(document).ready(function(){ $("#input_6_4\\.3_label").html("City/Borough"); $("#input_6_8\\.3_label").html("City/Borough"); $("#gform_next_button_6_42").click(function(){ alert("hi"); )}; });
Jquery.js?ver=1.12.3:2 Uncaught Error: Syntax Error, Unrecognized Expression: [href=#]
Firebug keeps spitting out a syntax error with the above code with the offender being these characters: )}; Any ideas at what's wrong because the code seems good to me? javascript jquery syntax-error share|improve this question edited Aug 22 '11 at 7:21 Brock Adams 52.1k9107158 asked Aug 22 '11 at 7:17 shahmeer navid 1001210 Hmm. Someone seems to be wanting to silently make a point. I think you received a syntax error unrecognized expression angular down-vote for not phrasing the title as a question... –Tieson T. Aug 22 '11 at 7:22 Also, if PaulPRO answered your question, don't forget to mark it as so. –Tieson T. Aug 22 '11 at 7:23 add a comment| 2 Answers 2 active oldest votes up vote 7 down vote accepted They are in the wrong order: )}; Should be: }); share|improve this answer answered Aug 22 '11 at 7:19 Paulpro 84k11150180 Cant believe I missed that, Thanks –shahmeer navid Aug 22 '11 at 7:19 add a comment| up vote 0 down vote it should be });, you close your arguments list before closing the function body. share|improve this answer answered Aug 22 '11 at 7:19 Michael Sagalovich 2,0201022 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged javascript jquery syntax-error or ask your own question. asked 5 years ago viewed 2798 times active 5 years ago Blog Stack Overflow
Web Dev @ Microsoft SEO By WooRank Books Courses Screencasts Newsletters Versioning Shop Forums Advertise Contribute Contact Us Our Story 995kSubscribers 132kFollowers
Syntax Error, Unrecognized Expression: [href=#] Wordpress
80kFollowers JavaScript Article Solutions to Common jQuery Errors By Sam Deering September 22, jquery unrecognized expression selector 2011 Let's face it, nobody is perfect! Everyone makes mistakes now and then and jQuery is the same - although error syntax error unrecognized expression href wordpress they have an excellent bug fixing team who are fixing up errors and enhancing jQuery around the clock errors may appear from time to time. In light of this and the fact that http://stackoverflow.com/questions/7144218/jquery-syntax-error I've been developing with jQuery for quite a while now and every now and then an error will show in the Firebug Console and "I have to Google it". I thought I would share some of the most common jQuery errors so that when you encounter them you might have some idea of how to solve the puzzle. Error: "jquery.1.4.2.js error "a is null"" Possible Causes a https://www.sitepoint.com/common-jquery-errors/ is null [Break On This Error] a))();else c.error("Invalid JSON: "+a)...(d)if(i)for(f in a){if(b.apply(a[f], jquery....min.js (line 29) I was thinking it might have something to do with this line failing because there was no matches. $.each(rawData.match(secureQueryRegex), function(index, currentQuery) Then, I was thinking it may have been the size of data as it was 69,443 characters long… Possible Solutions But I eventually found out it was bad characters inside the data string (which was grabbed directly from HTML). See cleanHTML() function to remove bad characters form HTML. rawData = rawData.replace(/[^<>a-zA-Z 0-9]+/g,''); /* clean up for match() statement */ Specific Versions Seen in 1.4.2 Error: "SyntaxError: invalid object initializer" Possible Causes Object declaration syntax error. $.getScript( { 'http://www.domain.com/js/preview.js' }); OR $("div").css( { padding:'0', margin,'4px' }); Possible Solutions Remove the brackets the getScript() function can be called with just the url. The same applies to any other object declaration or function call with an object that doesn't accept one. $.getScript('http://www.domain.com/js/preview.js'); Change the comma to a semi colon. $("div").css( $("div").css( { padding: '0', margin: '4px' }); Specific Versions Seen in 1.4.2 Error: "uncaught exception: Syntax error, unrecognized expression: [object HTMLLIElement]" Possible Causes This seems like a jQuery selector error. It seems to appea
Sign in Pricing Blog Support Search GitHub This repository Watch 3,320 Star 41,904 Fork 11,457 jquery/jquery Code https://github.com/jquery/jquery/issues/2885 Issues 57 Pull requests 11 Projects 0 Wiki Pulse Graphs New issue Syntax error, unrecognized expression: a[href*=#]:not([href=#]) #2885 Closed DevelopOnline opened this Issue Jan 29, 2016 · 2 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 3 participants DevelopOnline commented Jan 29, 2016 syntax error I have used $('a[href*=#]:not([href=#])') selectior somewhere in my code like this: $('a[href*=#]:not([href=#])').click(function () { console.log("Hello World"); }) It has worked without any issue with jQuery v2.1.4 and jQuery migrate v1.2.1, but I get this error message when I try to use jQuery 2.2.0 and jQuery migrate 1.3.0: Error: Syntax error, unrecognized expression: a[href*=#]:not([href=#]) syntax error unrecognized jquery-2.2.0.js:1463:8 I'm using Firefox v44.0 Any Suggestion?! 👍 1 staabm commented Jan 29, 2016 your selector is not valid. # is a special char and needs to be escaped like 'a[href*=\\#]:not([href=\\#])' see https://api.jquery.com/category/selectors/ 👍 31 😄 2 jQuery Foundation member dmethvin commented Jan 29, 2016 Yes, this is another duplicate of gh-2824. 👍 1 dmethvin closed this Jan 29, 2016 This was referenced Feb 1, 2016 Closed Warn about unqoted attribute selectors containing # jquery/jquery-migrate#140 Closed Fix issue with magellan and jquery 2.2 zurb/foundation-rails#174 Closed jQuery 2.2.1 incompatibility with 2.1.4 selector #3009 Closed :not selector not working #3017 Closed unrecognized expression [href=#thanksModal] mykhailo-petrenko/sbmodal#1 Closed Crashing when running a selector with unquoted attribute-value #3079 domProjects pushed a commit to domProjects/CI-AdminLTE that referenced this issue May 6, 2016 Emmanuel Campait