Dom Exception 12 Syntax Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta how to fix dom exception syntax err 12 Discuss the workings and policies of this site About Us Learn more dom exception invalid character err 5 about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack dom exception 8 Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping
Uncaught Error: Syntax_err: Dom Exception 12 Postmessage
each other. Join them; it only takes a minute: Sign up SYNTAX_ERR: DOM Exception 12 - Hmmm up vote 33 down vote favorite 6 I have been working on a small slideshow / public display for a client that uses HTML5 Rock's Slideshow code. I have run into a DOM Exception 12 - a syntax error that mysql syntax error exception is supposedly related to CSS selectors - while monkeying around with it... but I can't trace it back to any changes I made in the code. I am thinking it might be something that was uncovered as I added features. I have traced it down to this object (live version here): var SlideShow = function(slides) { this._slides = (slides || []).map(function(el, idx) { return new Slide(el, idx); }); var h = window.location.hash; try { this.current = h; } catch (e) { /* squeltch */ } this.current = (!this.current) ? "landing-slide" : this.current.replace('#', ''); if (!query('#' + this.current)) { // if this happens is very likely that someone is coming from // a link with the old permalink format, i.e. #slide24 alert('The format of the permalinks have recently changed. If you are coming ' + 'here from an old external link it\'s very likely you will land to the wrong slide'); this.current = "landing-slide"; } var _t = this; doc.addEventListener('keydown', function(e) { _t.handleKeys(e); }, false); doc.addEventListener('touchstart', function(e) { _t.handleTouchStart(e); }, false); doc.addEventListener('touchend'
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 Overflow the company Business Learn syntax_err: dom exception 12 chrome more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Dom Exception 12 An Invalid Or Illegal String Was Specified
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you,
Capybara Dom Exception 12
helping each other. Join them; it only takes a minute: Sign up Error: SyntaxError: DOM Exception 12 on Tag Creation Using jQuery up vote 6 down vote favorite 1 I have the following javascript: var orderItemQuantity = $('', http://stackoverflow.com/questions/7315162/syntax-err-dom-exception-12-hmmm { type: 'hidden', name: 'order_detail[][quantity]', value: itemQuantity }); The above javascript throws the following error message: Error: SyntaxError: DOM Exception 12 This one works without error: var newListItem = $('
', { html: $('#item_name_'+itemId).text() + '(' + $('#item_quantity_' + itemId).val() +')' + 'Delete this' + '', id: itemId }); I checked the following question but the answer did not specify clearly the correct reason WHY. http://stackoverflow.com/questions/15714601/error-syntaxerror-dom-exception-12-on-tag-creation-using-jquery Here is my DTD: Question: Why does $('') and $('') throw the said exception while $('') is not a problem? javascript jquery dom syntax-error dtd share|improve this question edited Mar 30 '13 at 3:32 asked Mar 30 '13 at 3:22 nmenego 58811228 add a comment| 1 Answer 1 active oldest votes up vote 7 down vote accepted Make sure you have jQuery loaded in your first example. Even if you don't have jQuery loaded, the function $() is now defined by Google Chrome as something similar to querySelectorAll(). This function only accepts a CSS selector as parameter and not arbitrary HTML like jQuery's $(). From the docs: SYNTAX_ERR code 12 In invalid or illegal string has been specified; for example setting the selectorText property of a CSSStyleRule with an invalid CSS value. The function is expecting a CSS selector and you gave it HTML so it gave a syntax error. See this fiddle, it works just fine: http://jsfiddle.net/S6d6w/ share|improve this answer edited Mar 30 '13 at 4:08 answered Mar 30 '13 at 3:50 Engwan 865821 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 postSign in Pricing Blog Support Search GitHub This repository Watch 73 Star 1,781 Fork 433 thoughtbot/capybara-webkit Code Issues 66 Pull requests 11 Projects 0 Wiki Pulse Graphs https://github.com/thoughtbot/capybara-webkit/issues/510 New issue Dom exceptions with capybara 2.1 #510 Closed mariovisic opened this Issue https://github.com/thoughtbot/capybara-webkit/issues/633 Apr 15, 2013 · 4 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 4 participants mariovisic commented Apr 15, 2013 After upgrading to capybara 2.1 and running on the HEAD version of capybara-webkit, i'm running into some errors. One in particular dom exception seems to occur for CSS selectors that are more than 1 level deep, eg this fails: find('.list-items .list-item:first') The error Capybara::Webkit::InvalidResponseError: SYNTAX_ERR: DOM Exception 12 is thrown changing the code to this seems to work fine: find('.list-items').first('.list-item') 👍 1 mhoran commented Apr 15, 2013 As of Capybara 2.1, CSS selectors are no longer translated to XPath via Nokogiri. :first is not a dom exception 12 valid CSS selector, but it seems that Nokogiri translates this to an appropriate XPath query. Given that CSS selectors are now evaluated natively (not translated to XPath), you'll want to use something like :first-child, or whatever is appropriate. mhoran closed this Apr 15, 2013 mariovisic commented Apr 15, 2013 @mhoran thanks for the explanation :) tgaff referenced this issue in teampoltergeist/poltergeist May 13, 2013 Closed Error on tr:last selector #296 betelgeuse referenced this issue in jnicklas/capybara Oct 3, 2013 twalpole 4f805d5 tmorris-fiksu commented Oct 25, 2013 Make sure to see the discussion here: jnicklas/capybara@4f805d5 for a work-around to make your transition to 2.1 easier if you have this problem. tmorris-fiksu referenced this issue in jnicklas/capybara Oct 25, 2013 Closed Rspec after hook being called before spec finishs #1089 ziemekwolski commented Aug 29, 2014 Thank you so much for posting this! Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Terms Privacy Secur
Sign in Pricing Blog Support Search GitHub This repository Watch 73 Star 1,781 Fork 433 thoughtbot/capybara-webkit Code Issues 66 Pull requests 11 Projects 0 Wiki Pulse Graphs New issue Simple selector returns Capybara::Webkit::InvalidResponseError: SyntaxError: DOM Exception 12 #633 Closed rodrigues opened this Issue Apr 24, 2014 · 4 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 4 participants rodrigues commented Apr 24, 2014 I'm upgrading a rails 3.2.17 application to 4.1, using ruby 2.1.1 The project was also very outdated regarding to capybara (2.0.2) and capybara-webkit (0.14.2). Now they are: * capybara (2.2.1) * capybara-webkit (1.1.0) The migration is going good overall, but I have a lot of these errors (image below): > find('#09f5d8574ad8') Capybara::Webkit::InvalidResponseError: SyntaxError: DOM Exception 12 As the picture shows above, after opening the page, I can see the li#09f5d8574ad8 there, but for some reason it doesn't work. Do you guys have any idea of what could be happening? EDIT: Something weird is that rarely the same call works, as in the image below: My qt5 info: ~ > brew info qt5 qt5: stable 5.2.1 (bottled), HEAD I also tried, just in case, to use capybara-webkit 1.1.1, but the problem remained the same. mhoran commented Apr 28, 2014 Well this is an odd one. Is this element loaded via Ajax or some other sort of JavaScript? It's possible that at the time of the test run, the element is not in the DOM, and at a later point it appears, hence why you can test it in a debugger. In the meantime, it could be that the WebKit CSS parser is incorrectly parsing your ID string as something else -- though that seems quite odd. mhoran commented Jul 1, 2014 Closing out for now. Let us know if you're still having issues. mhoran closed this Jul 1, 2014 zacharyjt commented Jul 18, 2014 I know this is closed, but I happened to come across this issue when searching for something else. A few weeks ago I ran into a problem identical to yours, and found that Capybara