Javascript Syntax Error Dom Exception 12
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
Safari Dom Exception 12
About Us Learn more about Stack Overflow the company Business Learn more dom exception 12 setrequestheader about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Dom Exception 12 An Invalid Or Illegal String Was Specified
Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up SYNTAX_ERR: DOM Exception syntax_err: dom exception 12 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 is supposedly related to CSS selectors - while monkeying around with it... but I can't trace it back to any changes I syntax_err: dom exception 12 capybara 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', function(e) { _t.handleTouchEnd(e); }, false); window.addEventListener('popstate', function(e) { if (e.state) { _t.go(e.state, true); } }, false); }; Instantiation of SlideShow() (line 521 in main.js): var slideshow = new SlideShow(queryAll('.slide')); Calling queryAll('.slide') returns an array of all the slides with an class of .slide.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the
Dom Exception 12 Phantomjs
workings and policies of this site About Us Learn more about Stack safari error syntaxerror dom exception 12 Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions
Jquery Dom Exception 12
Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join http://stackoverflow.com/questions/7315162/syntax-err-dom-exception-12-hmmm them; it only takes a minute: Sign up Error: SyntaxError: DOM Exception 12 setRequestHeader@[native code] up vote 6 down vote favorite I am in the process of developing a mobile application for Android and IOS, with Phonegap and AngularJS, CORS_REST. I have just about everything working for the headers on Android. When testing on an iPhone with GapDebug. Here http://stackoverflow.com/questions/34620703/error-syntaxerror-dom-exception-12-setrequestheadernative-code is an example of the authentication code: $http.post('someurlhere', {username: username, password: password}) .then(function (response) { if(!response.IsAuthenticated) { alertsManager.addAlert('Username or password is incorrect', 'alert-danger'); } callback(response); console.log(response); }); I am getting this a an error: SyntaxError: DOM Exception 12_IMG If anyone could please help I would greatly appreciate it. Thank You: iphone angularjs http-headers cors share|improve this question edited Jan 7 at 21:19 asked Jan 5 at 20:32 Jon Nowak 357 add a comment| 1 Answer 1 active oldest votes up vote 10 down vote accepted Please, check your headers params, iOS9 does not accept parameters in the http headers that has space at the beginning of the value. Example: "Token":" Token12345" => wrong "Token":"Token12345" => correct I hope this helps you. share|improve this answer answered Jan 6 at 13:53 William Sousa 11613 Would this be on the server side? –Jon Nowak Jan 7 at 14:04 3 Great catch! In case it's useful for someone else: I think a trailing space also causes this error. For example including a header like this: "A
are noticing this error for dom exception network requests. Its triggered when a network request is made using $http service. ** After Digging around, I figured the cause of dom exception 12 this is triggered by adding custom headers to network request. headers should not have a leading space in the value. for example in my case "Authorization": " Token 123456789" leading space before "Token"was causing the issue, removing it fixed this issue for me. Its working fine on iOS 8 OS: iOS 9Angular: 1.3.13Ionic: 1.1.0 [Error] Error: SyntaxError: DOM Exception 12setRequestHeader@[native code]file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/angular.js:9769:33forEach@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/angular.js:331:24file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/angular.js:9767:14sendReq@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/angular.js:9628:21serverRequest@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/angular.js:9344:23processQueue@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/angular.js:13189:29file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/angular.js:13205:39$eval@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/angular.js:14401:28$digest@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/angular.js:14217:36$apply@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/angular.js:14506:31file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/ionic-angular.js:11656:19dispatch@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/jquery.js:4435:14handle@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/jquery.js:4121:33dispatchEvent@[native code]triggerMouseEvent@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/ionic.js:2858:20tapClick@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/ionic.js:2847:20tapTouchEnd@file:///var/mobile/Containers/Bundle/Application/1234/myapp.app/www/ionic.js:2970:13 (anonymous functi