Done, ticket http://dev.jquery.com/ticket/4905

Already successfully tested locally and online.

Here a quick example about how to obtain a jQuery from a sandbox without
affecting anything around and being able to use jQuery in presence of other
libraries such Prototype.

*iframe src page*
<script type="text/javascript" src="javascript/jquery.min.js"></script>
<script type="text/javascript">
// reassign parent dollar and jQuery if already present
parent.jQuery.noConflict(true)(
    // call the callback on ready
    parent[/jQueryFn=([^&]+)/.exec(location.href)[1]]
);
</script>

That's it, all we need to do is to include an iframe in the main page
specifying the callback function in the query string.

*main page*
<!DOCTYPE html>
<html>
    <head>
        <style type="text/css">
        /* style the iframe */
        #jQuery {
            width: 1px;
            height: 1px;
            position: absolute;
            top: -10000px;
            left: -10000px;
        }
        </style>
        <script type="text/javascript">
        // the ready callback
        function jQueryReady($){
            $("body").html("Here I Am");
        };
        </script>
    </head>
    <body>
        <iframe id="jQuery"
src="jquerysandbox.html?jQueryFn=jQueryReady"></iframe>
    </body>
</html>

Best Regards,
Andrea Giammarchi


On Wed, Jul 15, 2009 at 11:11 AM, Andrea Giammarchi <
andrea.giammar...@gmail.com> wrote:

> John, I just realized latest from trunk has a window variable and an
> undefined one.
>
> I need to change the core.js file then to make window replacement
> available.
>
> document = window.document,
>
> is that OK?
>
>
> On Wed, Jul 15, 2009 at 12:28 AM, Andrea Giammarchi <
> andrea.giammar...@gmail.com> wrote:
>
>> Not now (I am with an USB pen without bandwidth allowed) ... I'll try
>> tomorrow during lunch break.
>>
>> Cheers
>>
>>
>> On Wed, Jul 15, 2009 at 12:19 AM, John Resig <jere...@gmail.com> wrote:
>>
>>> Cool - could you file a bug along with a patch to src/intro.js
>>> src/outro.js? Thanks!
>>>
>>> --John
>>>
>>>
>>>
>>> On Tue, Jul 14, 2009 at 7:04 PM, Andrea Giammarchi <
>>> andrea.giammar...@gmail.com> wrote:
>>>
>>>> It would be perfect, cause to build a sandbox version of jquery, if
>>>> necessary, the only file we need to change in the entire library is the 
>>>> last
>>>> one, avoiding conflicts, side effects, and stress! :-)
>>>>
>>>> That parent.document || document was just my solution for my problem
>>>> while this change will be really appreciated. Also rather then rebuild, we
>>>> just need to copy the file and change sent parameter at the end ... too
>>>> easy!
>>>>
>>>> Best Regards
>>>>
>>>> On Jul 14, 2009 8:36 PM, "John Resig" <jere...@gmail.com> wrote:
>>>>
>>>> As we discussed on IM, the parent.document || part would be untennable
>>>> (since it would make all iframed copies of jQuery incapable of operating
>>>> within the frame itself).
>>>>
>>>> Would the resulting change,
>>>>
>>>> (function(document){
>>>>
>>>>
>>>> })(document);
>>>>
>>>> be acceptable?
>>>>
>>>> --John
>>>>
>>>> On Tue, Jul 14, 2009 at 11:32 AM, Andrea Giammarchi <
>>>> andrea.giammar...@gmail.com> wrote: > > Solv...
>>>>
>>>>
>>>>
>>>>
>>>
>>> >>>
>>>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to