Bug Tracker

Modify

Ticket #3176 (closed bug: duplicate)

Opened 5 years ago

Last modified 5 years ago

JQuery doesn't play nice with scriptaculous v1.7.1_beta3

Reported by: ben Owned by:
Priority: major Milestone: 1.3
Component: core Version: 1.2.6
Keywords: jquery scriptaculous Cc: ben
Blocking: Blocked by:

Description

I came across this because I inject jQuery into websites from an extension. jQuery's makeArray function uses array detection logic that is incompatible with a particular version of scriptaculous, because it assumes anything that has a "call" method isn't an array. This particular version of scriptaculous of course adds a function "call" to Array.prototype. This patch does more accurate array detection.

See  http://vox1.cdn.amiestreet.com/static/r/hmWUFg/js/effects.js?zip=1.

Attachments

compat-fix.diff Download (187 bytes) - added by ben 5 years ago.
Fix for jquery 1.2.6

Change History

Changed 5 years ago by ben

Fix for jquery 1.2.6

comment:1 Changed 5 years ago by flesler

  • Status changed from new to closed
  • Resolution set to duplicate

No, that's not a valid fix. FF reports RegExps as functions, and Safari does the same for nodelists.

This was already addressed, and we'll try to patch this effectively for 1.3.

comment:2 Changed 5 years ago by flesler

I did some research... Scriptaculous 1.8.x plays well with jQuery. So you can just update your scriptaculous instead.

comment:3 Changed 5 years ago by ben

Please consider re-opening this ticket. As I said before, I inject jQuery into websites so I don't really get a choice as to what version of scriptaculous somebody uses. There might be several other applications for injecting jQuery into arbitrary websites: bookmarklets come to mind. I also could imagine someone's personal Javascript code adding a function named "call" to Array's prototype, and wondering why $("some_tag") returns an array of an array of elements.

I'm sure we could come up with slightly better logic that could fix my problem--for instance, checking typeof and looking for the call function. Thanks.

comment:4 Changed 5 years ago by flesler

  • Status changed from closed to reopened
  • Resolution duplicate deleted

comment:5 Changed 5 years ago by flesler

  • Cc ben added
  • Status changed from reopened to closed
  • Resolution set to duplicate

This has been taken into account in the end. Fixed at [5825].

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.