Skip to content

Tag: cross-browser

Javascript – What is alternative to find function?

I am using find () function for one of my project. Official document says that Internet Explorer is not supported. What else can I use? Answer A polyfill is a code that provides the functionality that you normally expect the browser to provide you natively. Here is the polyfill for Array.find

setTimeout function not working on firefox

I am trying to use <input type=”submit” name=”add” class=”buy” onClick=”setTimeout(‘history.go(0);’,2000);”/> It reloads the page on click after two seconds in chrome but it doesnt work in Firefox. I went through this Why does window.location.reload need setTimeout to work in firefox. It still didn’t work for me. Please help me find a way I can achieve […]

Getting a browser’s name client-side

Is there any object or method that returns data about the browser, client-side? For example, I need to detect if the browser is IE (Interner Explorer). Following is the code snippet. Is there a better way? Answer EDIT: Since the answer is not valid with newer versions of jquery As jQuery.browser is deprecated in ver 1.9, So Use Jquery Migrate

Detecting when Iframe content has loaded (Cross browser)

I’m trying to detect when an iframe and its content have loaded but not having much luck. My application takes some input in text fields in the parent window and updates the iframe to provide a ‘live preview’ I started with the following code (YUI) to detect when the iframe load event occurs. ‘preview-pane’ is the ID of my iframe