Closed jacquescrocker closed 14 years ago
no, you're right. I never tested on IE because I don't usually support it. Mozilla has written compat functions you can copy paste into a small compat library. Here is the one for forEach:
https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Objects/Array/ForEach
Another big problem is you have regex methods that you are executing as a function. For example
reg = /something/i
reg("something")
this works fine in firefox, but explodes in IE. Needs to use .exec
found a few places so far where you're doing this. i'll submit a patch to fix
cool, thanks.
got it to stop erroring out, however the actual output on IE is a mess. Very often it just spits out the template file
Would you mind if I patched a warning on the README that its not IE compatible? This is going to bite a lot of people in the ass
Is the generated html not correct? If it is, then it's not a problem with haml, but the way you're inserting the html into the dom. Honestly, I never intended this library to be used in the browser at all, but I assume that innerHTML or something should do the right thing.
Right, the generated HTML is not correct in IE. Works great in Firefox, Chrome, Opera, etc.
Yeah, looks like I probably shouldnt have tried to use this for browser templating. Ah well, live and learn :-)
I'm interested to see why it's wrong in ie6, the code doesn't use dom or anything browser specific. As long as your compat library is right, is should work the same on IE
BTW... not just IE6. All IE (6, 7, 8). I havent even tried it in IE6 actually, just ie7 and ie8
BTW... I'd now recommend against including my fork commits
In the end, I just didnt really quite understand what "server side javascript" meant :-)
closing issue
I've made some changes and added on a bunch of ie compatibility functions to make it work on a client side as well. The changes require jQuery.
Seems like haml.js is using some JS methods that dont exist in IE
[].forEach
and matcher.regexp
probably others. I'm working through them 1 by 1. Am i missing a required compatibility library?