Hi,

I would like to call crossite script.
So I use the script tag technique (create script tag, assign src and append
to head) to do so.
But unlike xmlhttprequest, I cannot get any response status from it.
So I just wonder if there is anyway I can detect if the remote script is not
available?

I tried to use try-catch, which works on Firefox but not IE. Code:

        $(document).ready(function(){
            try{
                var s = document.createElement("script");
                s.type = "text/javascript";
                s.src = "http://thisurldoesnotexist/dsfsdlfjk.js";;
                document.appendChild(s);
            }
            catch(e){
                alert("any error");
            }
        });

-- 
Best Regards,
Jacky
網絡暴民 http://jacky.seezone.net

Reply via email to