X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F06_net%2F02_XNetJSONP.js;fp=0.6.x%2Fjs%2F06_net%2F02_XNetJSONP.js;h=8832b964a745de97d8b013d7baf43708b34d547d;hb=a130cabd01fde8865990a59d849f5d5d08ed2119;hp=9e1eac2b28384ac0f508832bcca526093c773c1d;hpb=9e30a8480de03f0b36d2411a0ecb7f1d0f47b61f;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/06_net/02_XNetJSONP.js b/0.6.x/js/06_net/02_XNetJSONP.js index 9e1eac2..8832b96 100644 --- a/0.6.x/js/06_net/02_XNetJSONP.js +++ b/0.6.x/js/06_net/02_XNetJSONP.js @@ -27,7 +27,7 @@ X.Net.JSONP = { X_NET_JSONPWrapper .asyncDispatch( { - type : jsonString ? X.Event.SUCCESS : X.Event.ERROR, + type : jsonString ? X_Event.SUCCESS : X_Event.ERROR, data : window.JSON ? JSON.parse( jsonString ) : eval( 'var a=' + jsonString + ';a' ) } ); @@ -62,7 +62,7 @@ function X_NET_JSONP_loadScriptInNinjaIframe( url ){ // http://d.hatena.ne.jp/cnrd/20080518/1211099169 // 最近の仕様変更(引数のtargetOriginとかMessageEventのoriginとか)にはまだ対応してないみたい - if( X_UA.Opera ){ + if( X_UA[ 'Opera' ] ){ html = [ ( window[ 'JSON' ] ? '' : '' ), '', '', '', @@ -138,7 +138,7 @@ function X_NET_JSONP_loadScriptInNinjaIframe( url ){ ]; X_Net_JSONP_onloadCount = 3; } else - if( X_UA.IE < 8 ){ // ie5-7 + if( X_UA[ 'IE' ] < 8 ){ // ie5-7 html = [ '', '', @@ -165,21 +165,21 @@ function X_NET_JSONP_loadScriptInNinjaIframe( url ){ X_NET_JSONP_NinjaIframe .refresh( html.join( '' ) ) - .listen( [ X.Event.SUCCESS, X.Event.ERROR ], X_NET_JSONPWrapper, X_NET_JSONP_iframeListener ); + .listen( [ X_Event.SUCCESS, X_Event.ERROR ], X_NET_JSONPWrapper, X_NET_JSONP_iframeListener ); }; function X_NET_JSONP_iframeListener( e ){ switch( e.type ){ - case X.Event.SUCCESS : + case X_Event.SUCCESS : console.log( 'iframe onload, but' ); if( ++X_NET_JSONPWrapper._onloadCount < X_Net_JSONP_onloadCount ) return; // TODO callback が無ければ error - X_NET_JSONPWrapper.asyncDispatch( 1000, X.Event.ERROR ); + X_NET_JSONPWrapper.asyncDispatch( 1000, X_Event.ERROR ); break; - case X.Event.ERROR : + case X_Event.ERROR : console.log( 'iframe onerror' ); - X_NET_JSONPWrapper.asyncDispatch( X.Event.ERROR ); + X_NET_JSONPWrapper.asyncDispatch( X_Event.ERROR ); break; }; X_NET_JSONP_NinjaIframe.unlisten();