I'm trying to use getNamedItem() function. I can correctly access items using Chrome, Firefox, IE9 and IE10 ... but not when using IE11.
According to this, it seems expected : http://www.w3schools.com/jsref/met_namednodemap_getnameditem.asp
My question is : do we have an equivalent function which could be used in order to work with IE11 ?
getNamedItem() is supported in IE9+, including IE11.
Try this in IE11.
Related
When I run this simple code in console :
performance.mark('start-mark');
performance.mark('stop-mark');
performance.measure('name','start-mark','stop-mark');
performance.measure returns PerformanceMeasure object (as in documentation https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure). The problem is that everything works fine in chrome, edge and safari. Unfortunately in firefox it reutrns undefined.
Beside documentation I checked also in caniuse.com and it should work.
Can you help me to run this "code" in firefox (version 93 - actual).
This appears to be a known implementation inconsistency in Firefox.
From https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure#browser_compatibility):
I worked around this using Performance.getEntriesByName:
performance.mark('start-mark');
performance.mark('stop-mark');
performance.measure('name', 'start-mark', 'stop-mark');
console.log(performance.getEntriesByName('name', 'measure')[0]);
I need to prevent the scroll caused by focus().
For this purpose, I found that if I use element.focus({preventScroll : true}) instead of element.focus(), it works fine, based on the documentation from mozilla.
However, this only works perfectly on Chrome but not in Firefox.
I'm wondering how could it be not supported by FireFox, when the documentation has been done by Mozilla.
Am I missing something here?
Focus method documentation by Mozilla
I used toLocaleString() method to input money comma in `javascript. But the problem is, IE and chrome browser result correctly except Safari browser. I delete cache several times but still doesn't work.
var test = 12300;
console.log('test:'+test.toLocaleString());
// 12,300 in IE,Chrome
// 12300 in Safari
The issue here is that number.toLocaleString is implemented differently on different browsers. On Safari, it chooses not to display with the person-friendly formatting we're used to. It is supported on safari, but its implementation isn't the same as IE, Chrome, or Firefox. See this link: http://forums.asp.net/t/2031925.aspx?toLocaleString+function+is+inconsistent+with+browser+
Also, Safari doesn't support using the locale parameter with toLocaleString, in case you tried setting that:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString
I'm trying to create new Window with GWT as it shown here: https://stackoverflow.com/a/4205058/898588
This works in FF, Chrome, but doesn't work in IE (IE9 in my case). I see exception in dev. mode:
(null): DOM Exception: HIERARCHY_REQUEST_ERR (3)
So, this string:
bdElement.getOwnerDocument().getElementById("mainbody").appendChild(config.getElement());
throws this exception.
I've tried:
bdElement.appendChild(config.getElement());
but it was unsuccessfully.
How to make it work in IE?
Solution was found:
bdElement.getFirstChildElement().setInnerHTML(config.getElement().getString());
This works in IE, Opera, Chrome, FF
To be more specific, you only need to use setInnerHTML() instead of appendChild(), so the following piece of code will work as well in IE9 and Chrome as far as I can tell:
bdElement.getOwnerDocument().getElementById("mainbody").setInnerHTML(config.getElement().getString());
This code works fine in Firefox window.opener.insertHTML but it doesnot work for IE. I just noticed that this code works even for IE9 but its not working for IE8
How can i get it to work for both the browsers?
The insertHTML command is for documents in design mode. It is a Mozilla invention and apparently isn't supported by IE.
Please try with pasteHTML insted of InsertHtml.