How can I get the stack trace for a JavaScript exception in IE 8?

function someFunction() { try { // Code that may throw an exception } catch (e) { logStackTrace(e); } } function logStackTrace(error) { var stackTrace = []; var caller = arguments.callee.caller; while (caller) { stackTrace.push(caller.name || caller.toString()); caller = caller.caller; } error.stack = stackTrace.join(“\n”); console.error(error); }

Javascript JSON Date parse in IE7/IE8 returns NaN

In older browsers, you can write a function that will parse the string for you. This one creates a Date.fromISO method- if the browser can natively get the correct date from an ISO string, the native method is used. Some browsers got it partly right, but returned the wrong timezone, so just checking for NaN … Read more

How do I disable the save password bubble in chrome using Javascript?

I found there is no “supported” way to do it. What I did was copy the password content to a hidden field and remove the password inputs BEFORE submit. Since there aren’t any passwords fields on the page when the submit occurs, the browser never asks to save it. Here’s my javascript code (using jquery): … Read more

How to force IE to reload javascript?

Add a string at the end of your URL to break the cache. I usually do (with PHP): <script src=”https://stackoverflow.com/my/js/file.js?<?=time()?>”></script> So that it reloads every time while I’m working on it, and then take it off when it goes into production. In reality I abstract this out a little more but the idea remains the … Read more

getting access is denied error on IE8

IE doesn’t allow manipulation of the type=”file” input element from javascript due to security reasons. Setting the filename or invoking a click event to show the browser dialog will result in an “Access is denied” error on the form submit – Internet Explorer is clever about remembering what methods have been invoked. Similar issue: http://www.webdeveloper.com/forum/showthread.php?t=181272