Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Alternatives to Protosafe?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Diodeus  
View profile  
 More options Jul 9, 3:10 pm
From: Diodeus <diod...@gmail.com>
Date: Thu, 9 Jul 2009 12:10:45 -0700 (PDT)
Local: Thurs, Jul 9 2009 3:10 pm
Subject: Alternatives to Protosafe?
I am working on a content delivery solution. This would allow people
to include some content on their page by adding a script tag. I would
like to add some slickness to the content, so I would like to use
Prototype.

I'm looking for some suggestions to safely add Prototype to the target
pages (I'm inserting a script tag dynamically) without interfering
with an existing copy of Prototype, jQuery or other libraries.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex McAuley  
View profile  
 More options Jul 9, 4:48 pm
From: "Alex McAuley" <webmas...@thecarmarketplace.com>
Date: Thu, 9 Jul 2009 21:48:20 +0100
Local: Thurs, Jul 9 2009 4:48 pm
Subject: Re: [Proto-Scripty] Alternatives to Protosafe?
You could check for the jQuery object - this will get round jQuery...

if(jQuery) {
..........................

}

There must be prototype only objects/functions/classes you can test for in
prototype....

I am not sure about other libraries but i think extjs uses the "Ext."
namespace and similar with yahoo


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diodeus  
View profile  
 More options Jul 9, 4:52 pm
From: Diodeus <diod...@gmail.com>
Date: Thu, 9 Jul 2009 13:52:03 -0700 (PDT)
Local: Thurs, Jul 9 2009 4:52 pm
Subject: Re: Alternatives to Protosafe?
I'd rather not test for conflicts, but rather to safely coexist.

On Jul 9, 4:48 pm, "Alex McAuley" <webmas...@thecarmarketplace.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
waldron.rick@gmail.com  
View profile  
 More options Jul 9, 4:58 pm
From: "waldron.r...@gmail.com" <waldron.r...@gmail.com>
Date: Thu, 09 Jul 2009 13:58:26 -0700 (PDT)
Local: Thurs, Jul 9 2009 4:58 pm
Subject: RE: [Proto-Scripty] Re: Alternatives to Protosafe?
Alex, he can just check for Prototype :)

if ( Prototype ) {
.....


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex McAuley  
View profile  
 More options Jul 9, 5:00 pm
From: "Alex McAuley" <webmas...@thecarmarketplace.com>
Date: Thu, 9 Jul 2009 22:00:10 +0100
Local: Thurs, Jul 9 2009 5:00 pm
Subject: Re: [Proto-Scripty] Re: Alternatives to Protosafe?
Doh!... didnt think of that


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex McAuley  
View profile  
 More options Jul 9, 5:00 pm
From: "Alex McAuley" <webmas...@thecarmarketplace.com>
Date: Thu, 9 Jul 2009 22:00:45 +0100
Local: Thurs, Jul 9 2009 5:00 pm
Subject: Re: [Proto-Scripty] Re: Alternatives to Protosafe?
well anything that uses "$" will not safley co-exist so you -need- to test
for conflicts in order to co-exist properly


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Foster  
View profile  
 More options Jul 9, 5:29 pm
From: Matt Foster <mattfoste...@gmail.com>
Date: Thu, 9 Jul 2009 14:29:16 -0700 (PDT)
Local: Thurs, Jul 9 2009 5:29 pm
Subject: Re: Alternatives to Protosafe?
Pretty sure you can run

jQuery.noConflict()

and then make sure anything dependant on jQuery's version of $ will
now have to use the more verbose reference of "jQuery"

There still may be issues, but Prototype was designed to be powerful,
not play nice.

--

http://positionabsolute.net

On Jul 9, 5:00 pm, "Alex McAuley" <webmas...@thecarmarketplace.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josh Powell  
View profile  
 More options Jul 10, 2:41 pm
From: Josh Powell <seas...@gmail.com>
Date: Fri, 10 Jul 2009 11:41:43 -0700 (PDT)
Local: Fri, Jul 10 2009 2:41 pm
Subject: Re: Alternatives to Protosafe?
You cannot safely add Prototype to the target pages.  Prototype
changes javascript in general, not just jQuery.  It adds methods to
native objects. If the target pages are already running jQuery in
noConflict() mode then you won't interfere, but if you put their pages
in noConflict() mode then you will mess up their javascript that
relies on it.  There could also be custom code that relies on for
(each in obj) that will break if you add prototype, and there is no
way to check for that.

You will also be breaking pages that use mootools, which does not have
a noConflict() mode.

Prototype does not have a noConflict() mode because the theory behind
it prevents that from happening, once native objects are extended
there is no way to unextend them.  You are going to have to use jQuery
or Dojo for this project if you want to add a library to their pages.
Probably jQuery as it only adds the jQuery variable to the global
namespace, and even then you should use noConflict() mode and return
the $ to its previous state before exiting your code, so in case they
are using jQuery you give them back use of $ before you are done.

If you want to do the least potential damage by adding Prototype to
others pages, then check to make sure it doesn't already exist, and
then check to make sure $ doesn't already exist, and if it does
disable any special effects or give a warning saying that this feature
cannot be used because it will interfere with the existing code.

Good luck!

On Jul 9, 12:10 pm, Diodeus <diod...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Foster  
View profile  
 More options Jul 10, 4:04 pm
From: Matt Foster <mattfoste...@gmail.com>
Date: Fri, 10 Jul 2009 13:04:23 -0700 (PDT)
Local: Fri, Jul 10 2009 4:04 pm
Subject: Re: Alternatives to Protosafe?
Besides the $ function and using for(var in ) for iteration over an
array.  I can't think of other conflicts prototype would cause with
existing code.

--

http://positionabsolute.net

On Jul 10, 2:41 pm, Josh Powell <seas...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josh Powell  
View profile  
 More options Jul 10, 4:28 pm
From: Josh Powell <seas...@gmail.com>
Date: Fri, 10 Jul 2009 13:28:18 -0700 (PDT)
Local: Fri, Jul 10 2009 4:28 pm
Subject: Re: Alternatives to Protosafe?
If other libraries or js code extend the native objects with the same
methods, the one included last wins.  In this case, it will almost
always be prototype because he is loading it dynamically.

On Jul 10, 1:04 pm, Matt Foster <mattfoste...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google