Sure... one quick and dirty way that comes to mind is to "AJAX" in the
prototype.js file (of course, using a lightweight or homebrewed Ajax
abstraction)...

(function() {

someAjaxAPI.request(pathToPrototype, onSuccess);

function onSuccess(responseText) {
eval(responseText);

//use prototype in code here now...

}

})();


This pattern is a nice little way to sandbox libraries inside blocks that
can't be touched by code outside of the module.

Another way to do it is to rig up your server side to read the contents of
the prototype.js file, and stream it into the initial page response inside
your (function(){})(); module...


Ryan Gahl
CEO
Nth Penguin, LLC
http://www.nthpenguin.com
--
Inquire: 1-920-574-2218
Blog: http://www.someElement.com
LinkedIn Profile: http://www.linkedin.com/in/ryangahl


On Sun, Mar 15, 2009 at 1:24 PM, seasoup <seas...@gmail.com> wrote:

>
> Is it possible to contain prototype in a scope like:
>
> (function() {
>
> use prototype here
>
> })();
>
> cant use it here,
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to