I actually posted to the dev list about a similar issue (using JSONP, which is script-like). I'd like to put a short timer on the script calls and receive a timeout if the callback function fails to fire.
Scott On 10/8/07, Jacky <[EMAIL PROTECTED]> wrote: > > 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 -- -- Scott Trudeau scott.trudeau AT gmail DOT com http://sstrudeau.com/ AIM: sodthestreets