weepy / o_O

Funnyface: HTML binding for teh lulz
http://weepy.github.com/o_O/
MIT License
149 stars 11 forks source link

List browser compatability #2

Closed dhm116 closed 12 years ago

dhm116 commented 12 years ago

It would be nice if you could test and list browser compatibility somewhere. For example, this works in Chrome 16.x but not IE7.

weepy commented 12 years ago

Unfort I don't have access to windows . Do you know the error that occurs in IE7 ?

weepy commented 12 years ago

There's also a test HTML that might be worth running : test/mocha.html

dhm116 commented 12 years ago

If I load the _random.html example, I get these errors:

SCRIPT438: Object doesn't support property or method 'forEach' 
o_O.js, line 210 character 5
SCRIPT5007: Unable to get value of the property '_id': object is null or undefined 
o_O.js, line 323 character 3

The todos sample produced:

SCRIPT438: Object doesn't support property or method 'indexOf' 
o_O.js, line 135 character 5

I encountered similar errors when I attempted to integrate o_O in to my existing app and view on IE7.

It appears as though IE7/IE8 have issues, however IE9 seems to work sometimes and not others.

weepy commented 12 years ago

k - I just pushed a fix for forEach and indexOf

dhm116 commented 12 years ago

I ran the mocha tests in IE7 (after downloading and modifying remote file references) and everything appears to have passed.

When I run either _random or the todos example, the error is now:

SCRIPT438: Object doesn't support property or method 'map' 
o_O.js, line 231 character 7

The _random.html sample still complains about:

SCRIPT5007: Unable to get value of the property '_id': object is null or undefined 
o_O.js, line 441 character 3
weepy commented 12 years ago

ok - pushed a fix

On Fri, Feb 10, 2012 at 3:08 PM, dhm116 reply@reply.github.com wrote:

I ran the mocha tests in IE7 (after downloading modifying remote file references) and everything appears to have passed.

When I run either _random or the todos example, the error is now:

SCRIPT438: Object doesn't support property or method 'map'
o_O.js, line 231 character 7

The _random.html sample still complains about:

SCRIPT5007: Unable to get value of the property '_id': object is null or undefined
o_O.js, line 441 character 3

Reply to this email directly or view it on GitHub: https://github.com/weepy/o_O/issues/2#issuecomment-3907375

dhm116 commented 12 years ago

Perhaps using something like what is suggested here - may be a cleaner solution than your latest commit, which is explicitly overriding the functions even if they are built in.

I've also put the suggested solution in a gist here (would LOVE to know how to embed gists in comments)

weepy commented 12 years ago

Actually it's not overwriting them it's wrapping them:

"function indexOf(array, obj, start) {"

On Fri, Feb 10, 2012 at 3:27 PM, dhm116 reply@reply.github.com wrote:

Perhaps using something like what is suggested here - may be a cleaner solution than your latest commit, which is explicitly overriding the functions even if they are built in.

I've also put the suggested solution in a gist here (would LOVE to know how to embed gists in comments)


Reply to this email directly or view it on GitHub: https://github.com/weepy/o_O/issues/2#issuecomment-3907711

weepy commented 12 years ago

did that fix work ?

dhm116 commented 12 years ago

Looking much better!

I don't think the issue with '_id' or 'id' is related to the naming of the property. I still get the same error, which means that, for some reason, the object instance is null.


SCRIPT5007: Unable to get value of the property 'id': object is null or undefined 
o_O.js, line 444 character 3

This happens even on IE9, so something else is going on here...

weepy commented 12 years ago

odd - I'll need to debug it properly.

On Fri, Feb 10, 2012 at 4:01 PM, dhm116 reply@reply.github.com wrote:

Looking much better!

I don't think the issue with '_id' or 'id' is related to the naming of the property. I still get the same error, which means that, for some reason, the object instance is null.


SCRIPT5007: Unable to get value of the property 'id': object is null or undefined
o_O.js, line 444 character 3

This happens even on IE9, so something else is going on here...


Reply to this email directly or view it on GitHub: https://github.com/weepy/o_O/issues/2#issuecomment-3908360

dhm116 commented 12 years ago

OK, turns out that 'object is null or undefined' issue was the result of a trailing comma:


var company = {
  people: o_O.collection([
    new Person('Bobby', 'Reado', 30 ),
    new Person('Bobby2', 'Readoo', 301, "green"),
  ])
}

as opposed to:


var company = {
  people: o_O.collection([
    new Person('Bobby', 'Reado', 30 ),
    new Person('Bobby2', 'Readoo', 301, "green")
  ])
}

Thanks for addressing the other errors! I think that probably closes this issue unless anybody else has found anything.

weepy commented 12 years ago

cool - added a section in Readme