milohuang / reverie

Reverie is a versatile HTML5 responsive WordPress framework based on ZURB's Foundation.
http://theakiba.com/reverie/
MIT License
916 stars 196 forks source link

updated js to use jQuery in no conflict mode. #22

Closed PeteSchuster closed 12 years ago

PeteSchuster commented 12 years ago

WordPress requires no conflict mode for all javscript

milohuang commented 12 years ago

Sounds good but not quite sure if I really want to merge the pulls (also the one you provided here: https://github.com/milohuang/reverie/pull/21). The framework is designed to better work with Foundation (even when Foundation updated). The JS files are from Foundation so the merge could affect the future update. I am no coder and not sure about the impact. Could you elaborate it a bit?

PeteSchuster commented 12 years ago

Pull 21 is mainly just the proper way to call javascript in WordPress. It doesn't affect the js at all, and when you update Foundation, it won't conflict with anything. Read more about it here: http://codex.wordpress.org/Function_Reference/wp_enqueue_script

As for the second one where I edited the JS file... Its pretty standard now to write all javascript in no conflict mode including jQuery. This way if another library is used, there are no conflicts. I also think that WordPress will through errors if you don't use it properly. WordPress comes with its own version of jQuery that you can enqueue as well. Its safe to assume that plugins etc that a user might use will utilize this jQuery that is bundled with WordPress, so including your version, plus another version seems silly.