I am using prototype and jquery, and as noted on many sites, there is some potential for conflicts. Now, I saw as well again and again this solution: - <html>
-
<head>
-
<script src="prototype.js"></script>
-
<script src="jquery.js"></script>
-
<script>
-
var $j = jQuery.noConflict();
-
-
// Use jQuery via $j(...)
-
$j(document).ready(function(){
-
$j("div").hide();
-
});
-
-
// Use Prototype with $(...), etc.
-
$('someid').hide();
-
</script>
-
</head>
-
<body></body>
-
</html>
Now, I have another, quite long javascript file which is being included and references jquery. There are lots of "$" refrences, such as "function($)", "$this.css", "$(_tagMain).data"...
Do I need to replace then all of the "$" with "$j"? Or could it be that I will then badly reference some of these calls/methods?
5 2608 Dormilich 8,658
Recognized Expert Moderator Expert
If I see it right, Prototype uses $, thus (and because jQuery is set to $j) anything you call using $ will try to execute the Prototype Framework.
if you want to use jQuery, you have to use $j.
if you want to use jQuery, you have to use $j.
Yes, that's something I understood. The question is more, if I need to replace each and every occurrence of "$" with "$j" in the JS file which uses jQuery?
Dormilich 8,658
Recognized Expert Moderator Expert
The question is more, if I need to replace each and every occurrence of "$" with "$j" in the JS file which uses jQuery?
that’s what the sentence implies. $ → Prototype, $j → jQuery. thus if you want to use jQuery (be it existing code or not) you have to use, resp. rewrite it to $j.
acoder 16,027
Recognized Expert Moderator MVP
I know this doesn't directly answer the question, but it's an important point nonetheless. Is there any reason why you need to use both prototype and jQuery? You should never really need to use more than one library/framework.
@acoder
Yes, I thought about that question too. But unfortunately, it seems that yes, as I have on lib using scriptaculous, and another one using jQuery.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Diodeus |
last post by:
I would like to set up an event observer outside of an object, so I
can't use this.bindAsEventListener. How can I pass the correct object
reference?
I tried something like this, and various...
|
by: outofmymind |
last post by:
Hi every1,
im trying to solve this question, i did some of it but i dont think that its correct or complete:
this is the question:
Write the definition of a class called Product. A Product...
|
by: hedgehog |
last post by:
I've always been a do-it-yourselfer when it comes to referencing DOM,
doing lil animations and Ajax queries, etc, but I thought I'd give
someone else's toolkit a spin.
Aside from sorting out...
|
by: ziobudda |
last post by:
Hi, I want ask you if, for a web portal/application, is better
prototype or Jquery? I don't want to innesc some type of flame, but
after the announce that drupal use JQuery and that the new...
|
by: Jens Kleine |
last post by:
Hi, I've been having some problems with system calls.
When I create a simple file like this
int main(int argc, char *argv)
{
int x;
printf("Checking if processor is available...");...
| |
by: nolo contendere |
last post by:
I've recently begun playing with prototype.js as well as
scriptaculous, and found both very helpful in developing web pages
with lots of pop. Modal boxes, SlideUp/Down, calendars, etc.
I've also...
|
by: kj |
last post by:
OK, here's another construct I've run into in the jQuery source
that I can't figure out. It looks like this:
return new jQuery.prototype.init( selector, context );
So basically, as far as I...
|
by: ashore |
last post by:
Guys, I see a fair bit of negativity around re subject package. Can
someone share your views, either way?
Thanks,
AS
|
by: liketofindoutwhy |
last post by:
I am learning more and more Prototype and Script.aculo.us and got the
Bungee book... and wonder if I should get some books on jQuery (jQuery
in Action, and Learning jQuery) and start learning about...
|
by: souporpower |
last post by:
Hello All
I am trying to activate a link using Jquery. Here is my code;
<html>
<head>
<script type="text/javascript" src="../../resources/js/
jquery-1.2.6.js"</script>
<script...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |