admin管理员组

文章数量:1431413

I am wondering if it is OK to use multiple javascript frameworks for example (jQuery, Raphael) in the same script (handling event & ajax with jQuery and drawing with Raphael) ?

I am wondering if it is OK to use multiple javascript frameworks for example (jQuery, Raphael) in the same script (handling event & ajax with jQuery and drawing with Raphael) ?

Share Improve this question edited Dec 15, 2018 at 14:38 Cœur 38.8k25 gold badges206 silver badges279 bronze badges asked Jun 11, 2010 at 8:34 Ayoub M.Ayoub M. 4,81810 gold badges43 silver badges52 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 6

Raphael isn't really a framework. It's a specialized library.

When it es to mixing frameworks, then it is usually a bad idea.

While you can usually persuade them to run without conflicting, you end using a lot of code that does the same job as a lot of other code in the page. This adds a lot of overhead to the page, which is bad for performance.

Yeah it's fine. jQuery will happily not bind to $ if you ask it (and need it):

jQuery.noConflict();

I don't think there's any problem about it since Raphael's demo already uses jQuery : http://raphaeljs./analytics.html (look at code source).

If you have good reason to do so: yes. Such a reason would be that both frameworks have different features. Obviously you should only use stable frameworks that have no known issues of interference with other frameworks (or provide a way to avoid interference, like jQuery does with the noConflict method)...

Anyway it might not be a bad idea to search the jQuery plugin directory (plugins.jquery.) to see if there's anything available like Raphael, or maybe a plugin that integrates Raphael with jQuery before bining the two yourself...

本文标签: jqueryis it right to combine javascript frameworksStack Overflow