domexception

Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry

左心房为你撑大大i 提交于 2019-12-11 15:27:24
问题 Here is the full code:- class code extends HTMLElement{ constructor(){ super(); const shadow = this.attachShadow({ mode: 'open' }); const code = document.createElement('code'); code.textContent = super.textContent; shadow.appendChild(code); } } var Ω = (function() { 'use strict'; /** * Create the constructor * @param {String} selector The selector to use */ var Constructor = function(selector) { if (!selector) return; if (selector === 'document') { this.elems = [document]; } else if (selector

Javascript SecurityError: DOM Exception 18 while accessing cookies

女生的网名这么多〃 提交于 2019-12-11 10:45:46
问题 Folks, I am working on WebOS Application for LGTV. In previous version my code was working fine while accessing cookie, but with updated WebOS it is giving me error as following: Can anyone help me over it? Thanks EDIT Here is the output when I try to access cookie in JS Console: 回答1: I see you are loading the app via file:// for testing. Cookies don't work for file:// urls. See this StackOverflow answer: Uncaught Error: SECURITY_ERR: DOM Exception 18 when I try to set a cookie 来源: https:/

Error: HIERARCHY_REQUEST_ERR: DOM Exception 3

血红的双手。 提交于 2019-12-08 15:45:15
问题 I'm trying to develop an app for Google Chrome: Packaged Apps In my apolicação, use the command $.get to retrieve an HTML page and insert it into the current page: Page HTML <body> <div id="wrap"></div> </body> Script $.get(url, function(html) { $("#wrap").html(html); }); The error occurs on the line: $("#wrap").html(html); Attempts Searching the internet, I found this question here on stackoverflow, but this did not help me much. Another detail is that this example is not a Chrome Web App.

How to catch DOMException in Chrome?

[亡魂溺海] 提交于 2019-12-05 02:09:48
I get this error: Uncaught (in promise) DOMException: lockOrientation() is not available on this device. code: 9 message: "lockOrientation() is not available on this device." name: "NotSupportedError" when I run the following code in Chrome: try { screen.orientation.lock('portrait'); } catch (error) { // whatever } The fact that the error is being thrown is expected, since Desktop Chrome doesn't support orientation locking. I'd like to catch the error so it doesn't litter the console, but wrapping it in a try...catch block doesn't seem to work. Why can't I catch it? Am I missing something? try

SECURITY_ERR: DOM Exception 18 when applying document.domain on both sites. How do I resolve this?

混江龙づ霸主 提交于 2019-12-04 06:33:26
I have a page at an internal server, server1.mydomain.com/page.jsp and another page at a different internal server, 10.x.x.x:8081/page.aspx. On server1.mydomain.com, I set document.domain in page.jsp like this: //page.jsp on server1.mydomain.com document.domain = document.domain; When I issue an alert on document.domain, it comes up as server1.mydomain.com. On the 10.x.x.x server, I set document.domain in page.aspx, as a result, like this: //page.aspx on 10.x.x.x document.domain = "server1.mydomain.com"; // test if same-origin policy violation occurs document.getElementById("div_el").innerHTML

getImageData causes “Uncaught Error: NOT_SUPPORTED_ERR: DOM Exception 9”

给你一囗甜甜゛ 提交于 2019-12-01 21:22:19
问题 I'm trying to get a feel for some image manipulation in HTML5. I am finding that when I try and use the getImageData method I get this JS exception thrown. I am using Chrome and running on localhost. Thanks! 回答1: Okay figured out what the problem was. All I have to say is "derp". I was using getImageData(x, x) but the way I was intending to use this requires 4 arguments getImageData(x,x,x,x) 回答2: It could be an issue with editing files on your local system using Chrome. You can close Chrome

getImageData causes “Uncaught Error: NOT_SUPPORTED_ERR: DOM Exception 9”

99封情书 提交于 2019-12-01 20:01:15
I'm trying to get a feel for some image manipulation in HTML5. I am finding that when I try and use the getImageData method I get this JS exception thrown. I am using Chrome and running on localhost. Thanks! Okay figured out what the problem was. All I have to say is "derp". I was using getImageData(x, x) but the way I was intending to use this requires 4 arguments getImageData(x,x,x,x) specman It could be an issue with editing files on your local system using Chrome. You can close Chrome and reopen it using flags --allow-file-access-from-files to allow local file editing. Came across this

SYNTAX_ERR: DOM Exception 12 - Hmmm

﹥>﹥吖頭↗ 提交于 2019-11-28 21:03:22
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 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

Invalid Character DOM Exception in IE9

不想你离开。 提交于 2019-11-27 13:30:00
The following piece of JS which used to work in IE8 is failing now in IE9. document.createElement('<iframe id="yui-history-iframe" src="../../images/defaults/transparent-pixel.gif" style="position:absolute;top:0;left:0;width:1px;height:1px;visibility:hidden;"></iframe>'); I get the following exception : SCRIPT5022: DOM Exception: INVALID_CHARACTER_ERR (5) Is the above piece of code not according to standards. What's the fix for the issue? The API for createElement specifies that the constructor wants a string that species the name of an element. It would appear that IE9 is more strictly

SYNTAX_ERR: DOM Exception 12 - Hmmm

亡梦爱人 提交于 2019-11-27 13:26:50
问题 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 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 ||