![]() |
modify prototype.js
Hi,
I know there's a sticky posting regarding the issue I'm facing, but I do hope to get some help even though I'm pretty sure you've read about this hundreds of times. Well, I have a page that needs to use both prototype and jquery frameworks, and without changing the jquery files. So, to make a long story short, is there a way to modify the prototype.js file so that it doesn't clash with jquery? If so, will I also need to modify all the .js files on my site that use the prototype framework? Thanks. |
First let me still ask you: do you really need to use both frameworks? What exactly are you trying to do?
|
well, I've been using a really-really-really lovely and cool balloon toolip for years, and it uses prototype. The problem is that one of my clients now wants some specific jquery functions (to allow the user to select an area from a picture and save that area to a file)... so I would prefer to use both frameworks so that I don't have to switch to a new balloon tooltip.
This will happen only on the page of the jquery image selection page, so I won't be running into any problems on my other pages... so I would prefer to go the hard way. Could I have your help? :) |
Generally it would be a good idea to run jQuery in noConflict mode. So it should be possible for you to run both jQuery and prototype libraries with (mostly) no change
Example: Code:
var jQ = jQuery.noConflict(); |
I've never used jQuery in noConflict mode, so can't speak to how well that works. But I've always understood that using ONE library is the best approach.
jQuery does have a nice tooltip, by itself, and there is a jQuery plugin for balloon tooltips that is also very nice, and could probably do a balloon tooltip that is not too different from what you're currently using. But if you insist on using both libraries, then devnull69's suggestion should work. |
I still suggest it is worthwhile having a look at jquery alternative tooltips such as this one. If not, devnull69's code looks cool :thumbsup:
|
Yes, I’d also pledge for a jQuery tooltip then. After all, styling is usually done with CSS so it should be no major issue to make it look exactly the same. jQuery’s “noConflict” mode should really only be the very last resort if you have no control over parts of the site or other scripts.
|
You don't even need to define a jQ variable because $ is just an alias for the jQuery variable in jQuery even when you don't use noconflict.
Code:
jQuery.noConflict(); |
| All times are GMT +1. The time now is 02:30 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.