@manhng

Welcome to my blog!

Browser IE11

March 5, 2020 13:19

Browser IE11 (edit)

https://support.microsoft.com/en-us/help/3135465/how-to-enable-javascript-in-windows

https://stackoverflow.com/questions/19999388/check-if-user-is-using-ie (HAY)

https://www.sitepoint.com/check-ie-version/

https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser (HAY)

DOMContentLoaded vs jQuery.ready

https://eager.io/blog/how-to-decide-when-your-code-should-run/

JavaScript HTML DOM EventListener

https://www.w3schools.com/js/js_htmldom_eventlistener.asp

https://www.w3schools.com/jsref/met_element_addeventlistener.asp

setTimeout

https://freetuts.net/settimeout-va-setinterval-trong-javascript-391.html

Examples

....
<script type="text/javascript" language="javascript">
function StyleForMsIEVersionOnly() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))
{
document.getElementById("tdElement").style.padingRight = "124px";
} else {
document.getElementById("tdElement").style.paddingRight = "94px";
}
}
function showWaitingMessage() {
document.getElementById("spanElement").style.display = 'block'; // to show SPAN
setTimeout(function () {
hideWaitingMessage();
}, 3000);
}
function hideWaitingMessage() {
document.getElementById("spanElement").style.display = 'none'; // to hide SPAN
}
window.addEventListener('DOMContentLoaded', function () {
StyleForMsIEVersionOnly();
document.getElementById("spanElement").style.display = 'none';
document.getElementById("btnAction").addEventListener("click", showWaitingMessage);
});
</script>
</div>
</asp:Panel>
</asp:Content>

Problem with new Date().toLocaleDateString() in IE11

July 17, 2019 09:59

IE11 Date Problem (edit)

IE11 > F12 to Debug > Copy date string value > Paste in w3schools

https://stackoverflow.com/questions/21413757/tolocaledatestring-changes-in-ie11

https://stackoverflow.com/questions/25294363/ie-11-issue-with-javascript-tolocaledatestring-formatting

Usage Code

<!DOCTYPE html>
<html>
<body>

<p>Click the button to extract characters from the string.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
var str = "‎MM‎/‎dd‎/‎yyyy".replace(/\u200E/g, '');

document.getElementById("demo").innerHTML = str;
}
</script>

</body>
</html>Abc

Categories

Recent posts