brianleroux / xui

A tiny javascript framework for mobile web apps.
http://github.com/xui/xui
391 stars 159 forks source link

Result of expression '$(window).load' [undefined] is not a function. #35

Closed buffpojken closed 13 years ago

buffpojken commented 13 years ago

When running on just core.js - trying any kind of events fails with the error above.

Is just running on core.js supported or are you supposed to use the entire more.js? The documentation is not very clear on this issue?

remy commented 13 years ago

XUI core doesn't provide event shortcuts, so you have to use:

$(window).on('load', fn);

That said, I'm about 90% sure that I want to move the shortcut handling in to core and ditch the more/events.js since it's so small now.

buffpojken commented 13 years ago

Thanks for the prompt reply!

Sadly, that doesn't seem to work either. On Safari 5.0.1 the following bombs with:

"Can't find variable: cache"

Code: $(window).on('load', function(e){ alert("ninja"); });

remy commented 13 years ago

Hmm - that's odd and shouldn't happen. Checking it out now for you.

remy commented 13 years ago

Odd. It works for me. I've got the latest build, and using xui-core.js from build-all.sh. Have you cleaned out and built from the latest?

buffpojken commented 13 years ago

Thanks for checking it out! No, I've actually used the release from Google Code, is that an old release? Should I rebuild from this repo instead?

buffpojken commented 13 years ago

I'm testing a build from this repo right now!

remy commented 13 years ago

Cripes! Yep, use this repo, I'll kick Brian a bit to try to kill off the google repo - it's hugely out of date!

buffpojken commented 13 years ago

Okay, no wonder it was kind of wonky then =) I'll try it out with this repo instead and get back if the issue persist!

Thanks!

buffpojken commented 13 years ago

Yes, everything works as it should now - let's close this issue!

Thanks for your help in resolving it, and yes - it might be a good idea to remove the google repos!

Cheers!