views:

49

answers:

2

I saw in a project that jquery-fx.js is being linked, but isn't it for show(), hide(), animate() etc, so jquery.js already has them?

+4  A: 

Yes, effects was pulled into jQuery core some time ago, you can see that chunk of the API here: http://api.jquery.com/category/effects/

If they're referring to a different file that just happens to be called jquery-fx.js...well, there's no way to tell what's happening there unless you post the contents of that file.

In case your curious, it was still called fx.js as recent as 1.3.2 (if you're including individual files/modules, instead of the whole library as most do). You can see what the code looked like here: http://github.com/jquery/jquery/tree/1.3.2/src

Nick Craver
Thanks. It is strange that the project is linking to jquery.js and jquery-fx.js and the jquery.js shows at the top of the file that it is jQuery 1.3.1, but in that file, I can find the definitions of `show()`, `hide()`, and `animate()` etc. It is the same situation in http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.js
動靜能量
@Jian - In that case it's just overriding the same functions, waste of bandwidth really :)
Nick Craver
@Nick so the standard is, if it is linking to jquery.js version 1.3.1 (as in the one hosted by Google), then it shouldn't be linking to jquery-fx.js as well?
動靜能量
@Nick it is very strange that jquery-fx.js doesn't have the definition of animate()... the beginning of the file is like this: `(function($){$.ec=$.ec||{};$.extend($.ec,{save:function(el,set){for(var i=0;i<set.length;i++){ ...`
動靜能量
looks like this `jquery-fx.js` is for jRails usage: using jQuery in Ruby on Rails... probably a standard release of the jRails code: http://justtalkaboutweb.com/2008/01/14/replace-prototype-with-jquery-on-rails/
動靜能量
A: 

As in the comment, jquery-fx.js is actually part of jRails.

動靜能量