Posts about ie

JSON with Special Characters fails in IE

If you try to eval a JSON string that has special characters in it(non-ascii, or chr > 127), it will error out. The other browsers work fine.
Posted by Toby 9 months ago about crossbrowser, ie, javascript, json and programming (0 comments)

Trying to Index Strings in IE

'abc'[0]
gets you undefined in IE. The correct way is to do 'abc'.charAt(0).
Posted by Toby 9 months ago about crossbrowser, ie, javascript and programming (0 comments)

IE Woes: One

Man! Have I been at war with IE lately. I have been holding back a lot of blog posts related to debug IE problems, and I going to start spewing them out now one by one. For the first installment I'll talk about one I encountered these couple of days...

Ever get this IE error?
When you click "Ok", this is what you see:

Ouch! Can this be any more catastrophic?(Yeah, that's my Chandler impression.)

According to this forum post, this happens if you have script tags in your document that's modifying other parts of the dom before the document finishes loading. Umm, okay, but I still had a hard time finding out the exact point this caused the problem. I used the comment-out-code-and-see-if-it-still-breaks-binary-search methodology, and came up with some work arounds which involved delaying the execution of some setup code. But, this catastrophic error came back to haunt be time and time again. Clearly I didn't find the root cause of this error or I wouldn't be committing it repeatedly.

But finally, I found it(I think, well at least one of the root causes). I am using firebug lite in development, which creates iframes and panels in the pages that pops out and in just like firebug. When you call console.log with firebug lite, guess what happens? Yeah, it modifies the console output window - a part of the dom that is outside of where the script tag is. Got rid of those console.log statements and fixed it.

In conclusion, do not do what I did!
Posted by Toby about 1 year ago about crossbrowser, ie, javascript and programming (0 comments)

IE getElementById looks up "name"

Posted by Toby about 1 year ago about crossbrowser, ie, javascript and programming (0 comments)

IE bug: input endtags show up as nodes

If you write an input element like this:
<input type="text" id="name" name="name" value="></input>
In IE, if you try to traverse the dom, you will get the end-tag as a separate element /input. Ex. with prototype: $('name').next() should get you /input.
Posted by Toby about 1 year ago about crossbrowser, html, ie, javascript and programming (0 comments)

Microsoft Script Debugger

I've finally gotten the hang of the Microsoft Script Debugger. I can now debug Ajax code in IE with relative ease. Before this, the error line number IE gives is always wrong, so there's no good way to know what is wrong with your code. I tried firebug lite, which provides the console, and is handy, but it has no debugging capability. The Script Debugger is very different from firebug, so you have to get use to it, and even maybe read the help pages. But once you figure out, it's very helpful, well because you are comparing it to having not debugger or a use full stacktrace message at all. It does have a command window, which is kinda different from firebug also, but once again, you can get used to it. And the call stack window is very useful for spotting where an error has occured.

Negatives: it does crash a lot, as with everything Microsoft. And once it had a bug where the included javascript files in the page would not show up at all. It was eventually fixed I think after a reboot. Still, better than nothing.
Posted by Toby about 1 year ago about ie and javascript (0 comments)