Jim, that info was extremely helpful.  I also noticed that $.load
calls .html which calls .append which in turn calls domManip, but
couldn't figure out why it still wasn't evaluating my scripts, and
therefore added the evalScripts back in.  The fact that script tags
have to be at the top level is something that I missed entirely.
Thanks for the pointer!

On Sep 14, 1:23 pm, Jim Marion <[EMAIL PROTECTED]> wrote:
> I did some looking at the code. The $.loadin 1.1.4 and 1.2 actually
> does eval scripts onIEwithout adding evalScripts back into the lib.
> The eval is in the domManip. It looks like $.loadcalls .html which
> calls .append. append calls domManip. The only problem is that the
> code doesn't do a deep search for script tags inIE. Therefore, forIE, you 
> script tags have to be at the top level. They don't appear to
> get evaluated if they are buried deeper in the document.
>
> On Sep 11, 10:03 am, Jolyon Terwilliger <[EMAIL PROTECTED]> wrote:
>
> > Check out the revisions made to .load() and the new getScript feature
> > of 1.2:  http://docs.jquery.com/Release:jQuery_1.2/Ajax
>
> > These may help you solve your problems!
>
> > peace,
>
> > Jt
>
> > On Sep 11, 3:05 am, Stamen Georgiev <[EMAIL PROTECTED]> wrote:
>
> > > I'm having the same problems here.
> > > And it looks the same with the latest release (1.2) :-(
>
> > > Help, anyone?
>
> > > On Sep 10, 7:26 pm, Bryan Blakey <[EMAIL PROTECTED]> wrote:
>
> > > > As many others have already noted, if your page makes anAJAXcall
> > > > that returnsjavascriptand HTML, for some reasonIEandSafariare
> > > > unwilling to execute any of thejavascript.  Looking through the
> > > > jQuery code, I noticed that there *used* to be an evalScripts function
> > > > in the same object as theloadfunction, but that is deprecated in
> > > > light of the fact that there is now a globalEval function that should
> > > > be called with certain of the the HTML injection methods.  However,
> > > > after numerous tests, it seems that this wasn't working all the time
> > > > in eitherSafariorIE.  I dediced to add the evalScripts function
> > > > back in like so:
>
> > > >         evalScripts: function( self ){
> > > >                 var scripts = self.get(0).getElementsByTagName( 
> > > > 'script' );
> > > >                 $(scripts).each(function(){
> > > >                         if ( window.execScript ) {
> > > >                                 window.execScript( $(this).html() );
> > > >                         }
> > > >                         else if ( jQuery.browser.safari) {
> > > >                                 window.setTimeout( $(this).html(), 0 );
> > > >                         }
> > > >                         else {
> > > >                                eval.call( window, $(this).html() );
> > > >                         }
> > > >                 });
> > > >         }
>
> > > > This gets called byloadif the oncomplete status is "success" with:
>
> > > >         self.evalScripts( self );
>
> > > > Can anyone tell me if this is a bad idea (and if so, why?) as well as
> > > > any insights into why the built in globalEval function doesn't always
> > > > work inIEorSafari?

Reply via email to