File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
sources/net.sf.j2s.java.core/srcjs/js Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -313,12 +313,23 @@ window.J2S = J2S = (function() {
313313 }
314314
315315 J2S . $getScriptAsync = function ( file , whenDone ) {
316+ // bad news: if the file does not exist, this fails to call any error. apparently fixed in JQuery 2.0
317+
316318 if ( J2S . _nozcore ) {
317319 file = file . replace ( / \. z \. j s / , ".js" ) ;
318320 }
319- return $ . getScript ( file , whenDone ) ;
321+ return J2S . $ajax ( {
322+ url : file ,
323+ type : "GET" ,
324+ dataType : "script" ,
325+ cache : "NO" ,
326+ statusCode : { 404 : function ( ) { alert ( "!" ) } } ,
327+ success : whenDone ,
328+ error : whenDone
329+ } ) ;
320330 }
321331
332+
322333 var fixProtocol = function ( url ) {
323334 if ( ! J2S . _isFile && url . indexOf ( "file://" ) >= 0 )
324335 url = "http" + url . substring ( 4 ) ;
You can’t perform that action at this time.
0 commit comments