views:

59

answers:

2

I'm putting together a bookmarklet that inserts jquery into pages it is invoked on. On many pages it works just fine, but on pages like http://www.cnn.com (which includes both prototype and scriptaculous) it behaves a bit strangely.

$(blah..).appendTo("body") does not work whereas $(blah..).appendTo(document.getElementsByTagName("body")[0]) works

$("#id").hide() , .show() and .css() don't work.

I've tried changing the variable from $ to jQuery to $k = jQuery.noConflict() but the results are the same.

Note: On many web pages it works fine, only on cnn.com and a few others it does not.

Has anyone come across this, do you have any pointers??

+1  A: 

http://docs.jquery.com/Using_jQuery_with_Other_Libraries

Luca Matteis
Well, as I've noted I've tried using $k = jQuery.noConflict() to no avail. .hide(), .show(), .css() etc. still do not work.
A: 

Answering my own q

The Array.prototype.call() in scriptaculous/effect causes this problem with jquery.

The solution is at http://dev.jquery.com/ticket/3248

molicule, that ticket does discuss this issue but it's not clear how you fixed the problem. i'm guessing you opted to refer to a more recent jQuery and this fixed it - is that the case?
Chris Burgess