Thanks a lot. You code fixed it in IE but broke firefox, but it using your
code I made it so that I could determine if the php script generating the
code should add script tags on it when it does its request and had it do a
.load function instead.

        <script language="JavaScript" type="text/JavaScript">
          
                function MyReload()
                {
                        //$("div#myMenuID").hide("fast");
                        
//$("div#filetreescript").load("/client/secure/filetree.php");
                        if (window.execScript)
                                $.get ( '/client/secure/filetree.php',
                                function( rtnTxt){
                                        installScript(rtnTxt);
                                }
                                );   
                        else
                                
$("div#filetreescript").load("/client/secure/filetree.php?code=ff");
                        //$("div#myMenuID").show("slow");                       
        
                };
        
                
                function installScript( script )
                {
                if (!script)
                        return;
                    //  Internet Explorer has a funky execScript method that 
makes this
easy
                        window.execScript( script );
                } 
        </script>



Kevin Pirkl wrote:
> 
> Internet Explorer wont execute dynamic code in that manner.  You have two
> options...  (I like the second one better.)  I tested through the second
> solution and it appears to work fine...
> 
> 1> Dynamic script head tag creation 
> 
> // Thanks to
> http://www.bluishcoder.co.nz/2006/12/cross-domain-json-with-fjsc.html for
> the code
> $("head/script#jsonrequest*").remove(); 
> var request = "testxml.htm";
> var script = document.createElement("script"); 
> script.setAttribute("type", "text/javascript");
> script.setAttribute("src", request + '?noCacheIE=' + (new
> Date()).getTime());
> script.setAttribute("charset", "UTF-8"); 
> script.setAttribute("id", "jsonrequest" + scriptCounter);
> $("head").append(script);
> scriptCounter++;
> 
> 
> 2> Or the followng installScript method
> (http://nerd.newburyportion.com/2006/07/going-global)
> // Take out your script tag wrapper, then detect browser via jQuery
> browser object for IE then call installScript()
> 
> // I like .get over .load 
> $.get ( '/client/secure/filetree.php'+ '?noCacheIE=' + (new
> Date()).getTime(),
>     function( rtnTxt){
>       installScript(rtnTxt);
>     }
> );  
> 
> function installScript( script )
> {
>     if (!script)
>         return;
>     //  Internet Explorer has a funky execScript method that makes this
> easy
>     if (window.execScript)
>         window.execScript( script );
>     else
>         window.setTimeout( script, 0 );
> }
> 
> Hope it helps
> 
> Kevin Pirkl (ZombieBob at Intel)
> 
> 

-- 
View this message in context: 
http://www.nabble.com/.load%28%29-not-executing-javascript-code-in-IE-tf2883329.html#a8077014
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to