Change $ to $p or $proto in prototype.js

51 views
Skip to first unread message

Amit Dwivedi

unread,
Oct 22, 2015, 5:38:49 AM10/22/15
to Prototype & script.aculo.us
Hi, 
Can we change $ in prototype.js to something else like $p or $proto

Thanks

Walter Lee Davis

unread,
Oct 22, 2015, 5:57:22 PM10/22/15
to prototype-s...@googlegroups.com
The framework doesn't provide any tools to enable that, but you could fork it and do that I suppose. You may have a larger issue because Prototype extends the prototype (small p) of a lot of different parts of the JavaScript language, and some of these changes mean that sloppily-written code will error out rather than sorta work. Iterating over an object with for .. in will also iterate over all of the methods that Prototype adds to every object, for example. This is fine if you have a normal object, but an Array is also an object, and it gets a bunch of new methods added to it as well. This breaks assumptions that code written in the absence of Prototype may be relying on to work at all.

Walter
> --
> You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scripta...@googlegroups.com.
> To post to this group, send email to prototype-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/prototype-scriptaculous.
> For more options, visit https://groups.google.com/d/optout.

Phil.petree

unread,
Oct 22, 2015, 6:10:28 PM10/22/15
to prototype-s...@googlegroups.com
The real question is, which problem are you trying to solve? Some sort of conflict?

Sent from my iPhone

Amit Dwivedi

unread,
Oct 29, 2015, 3:16:55 AM10/29/15
to Prototype & script.aculo.us
Thanks for the reply Walter, changing $ to $p causing some problem(like calling jquery hide or show function, prototype.js function gets called). So i what did to solve the conflict is to open a prototype.js related things in new tab and using jquery.noConflict().

Thanks,
Amit


On Friday, October 23, 2015 at 3:27:22 AM UTC+5:30, Walter Lee Davis wrote:
The framework doesn't provide any tools to enable that, but you could fork it and do that I suppose. You may have a larger issue because Prototype extends the prototype (small p) of a lot of different parts of the JavaScript language, and some of these changes mean that sloppily-written code will error out rather than sorta work. Iterating over an object with for .. in will also iterate over all of the methods that Prototype adds to every object, for example. This is fine if you have a normal object, but an Array is also an object, and it gets a bunch of new methods added to it as well. This breaks assumptions that code written in the absence of Prototype may be relying on to work at all.

Walter

On Oct 22, 2015, at 1:58 AM, Amit Dwivedi <amydw...@gmail.com> wrote:

> Hi,
> Can we change $ in prototype.js to something else like $p or $proto
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsub...@googlegroups.com.

Amit Dwivedi

unread,
Oct 29, 2015, 3:18:43 AM10/29/15
to Prototype & script.aculo.us
Yeah pete, i was getting conflict while i was using jquery and prototype.js together.


On Friday, October 23, 2015 at 3:40:28 AM UTC+5:30, Pete wrote:
The real question is, which problem are you trying to solve? Some sort of conflict?

Sent from my iPhone

> On Oct 22, 2015, at 5:57 PM, Walter Lee Davis <wa...@wdstudio.com> wrote:
>
> The framework doesn't provide any tools to enable that, but you could fork it and do that I suppose. You may have a larger issue because Prototype extends the prototype (small p) of a lot of different parts of the JavaScript language, and some of these changes mean that sloppily-written code will error out rather than sorta work. Iterating over an object with for .. in will also iterate over all of the methods that Prototype adds to every object, for example. This is fine if you have a normal object, but an Array is also an object, and it gets a bunch of new methods added to it as well. This breaks assumptions that code written in the absence of Prototype may be relying on to work at all.
>
> Walter
>
>> On Oct 22, 2015, at 1:58 AM, Amit Dwivedi <amydw...@gmail.com> wrote:
>>
>> Hi,
>> Can we change $ in prototype.js to something else like $p or $proto
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsub...@googlegroups.com.
>> To post to this group, send email to prototype-s...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/prototype-scriptaculous.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsub...@googlegroups.com.

Phil.petree

unread,
Oct 29, 2015, 7:55:54 AM10/29/15
to prototype-s...@googlegroups.com
I suspected that's what it was and was gonna suggest jquery.noconflict

Sent from my iPhone
To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scripta...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages