Last summary ... this code is the best I have tried so far but I still miss
the jQuery init method cause I am forcing it via an array returned by Sizzle

parent.jQuery = (function(){
    function $jQuery(){};
    function $(selector, context){
        return init.call(new $jQuery, Sizzle(selector, context ||
document));
    };
    var document = parent.document,
        init = jQuery.fn.init,
        Sizzle = jQuery.find,
        k
    ;
    for(k in jQuery)
        $[k] = jQuery[k]
    ;
    $.prototype = $jQuery.prototype = jQuery.fn;
    return $;
})();

all this stuff does not make sense if i introduced in-scope document and I
set it in the sandbox ( in any case if I create a sandbox for jQuery it does
not make sense to redefine it more than once, agree? )

jQuery.setDefaultDocument(parent.document);
parent.jQuery = jQuery;

that's it, I prefer much more latest snippet. In both case the injected
ready method cause an error. In few words that method assumes the body is
ready. I do not remember why the body is necessary, I tried with
documentElement and I obtained same results.

Can anybody refresh my memory explaining me the reason there is an injected
0 index callback by default in bindReady?

Thanks

On Mon, Jul 13, 2009 at 10:23 AM, Andrea Giammarchi <
andrea.giammar...@gmail.com> wrote:

> As quick update, I successfully tested this code from the sandbox:
>
> parent.jQuery = (function(){
>     var $ = Function(),
>         document = parent.document,
>         init = jQuery.fn.init,
>         Sizzle = jQuery.find
>     ;
>     $.prototype = jQuery.fn;
>     return function(selector, context){
>         return init.call(new $, Sizzle(selector, context || document));
>     };
> })();
>
> from the parent document and with these selectors:
>
> jQuery("#test").html("Select By Id");
> jQuery(".test").html("Select By class");
> jQuery("div:eq(2)").html("Select By Tag Name");
>
> everything worked perfectly except an error with jQuery on line 3230
>
> 3225 // document.body must exist before we can do this
> 3226 jQuery(function(){
> 3227 var div = document.createElement("div");
> 3228 div.style.width = div.style.paddingLeft = "1px";
> 3229
> 3230 document.body.appendChild( div );
> 3231 jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
> 3232 document.body.removeChild( div ).style.display = 'none';
> 3233 });
>
> ... any clue?
>
> Regards
>

--~--~---------~--~----~------------~-------~--~----~
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