OSDN Git Service

Version 0.6.135, fix for closure compiler.
[pettanr/clientJs.git] / 0.6.x / js / 06_net / 02_XNetJSONP.js
index 04bfc4a..6c008f0 100644 (file)
@@ -19,8 +19,8 @@
  * TODO postMessage
  */
 
-X.Net.JSONP = {
-       cb : function( accessKey, jsonString, time, opt_json2FileSize ){
+X[ 'Net' ][ 'JSONP' ] = {
+       'cb' : function( accessKey, jsonString, time, opt_json2FileSize ){
                        if( accessKey !== X_NET_JSONP_ACCESS_KEY || !X_NET_JSONPWrapper._busy ) return;
                        
                        X_NET_JSONPWrapper._busy = false;
@@ -54,7 +54,7 @@ function X_NET_JSONP_loadScriptInNinjaIframe( url ){
                json2FileSize = 18103,
                html;
        
-       X_NET_JSONP_NinjaIframe || ( X_NET_JSONP_NinjaIframe = new X.Util.NinjaIframe() );
+       X_NET_JSONP_NinjaIframe || ( X_NET_JSONP_NinjaIframe = X[ 'Util' ][ 'NinjaIframe' ]() );
        
        // TODO '<scr'+'ipt> 化 恐らくアンチウイルスソフトが反応しないための対策
        // TODO postMessage の利用
@@ -164,7 +164,7 @@ function X_NET_JSONP_loadScriptInNinjaIframe( url ){
        };
        
        X_NET_JSONP_NinjaIframe
-               .refresh( html.join( '' ) )
+               [ 'refresh' ]( html.join( '' ) )
                [ 'listen' ]( [ X_EVENT_SUCCESS, X_EVENT_ERROR ], X_NET_JSONPWrapper, X_NET_JSONP_iframeListener );
 };
 
@@ -172,7 +172,7 @@ function X_NET_JSONP_loadScriptInNinjaIframe( url ){
 function X_NET_JSONP_iframeListener( e ){
        switch( e.type ){
                case X_EVENT_SUCCESS :
-                       console.log( 'iframe onload, but' );
+                       console.log( 'iframe onload, but ' + X_NET_JSONPWrapper._onloadCount + ' < ' + X_Net_JSONP_onloadCount );
                        if( ++X_NET_JSONPWrapper._onloadCount < X_Net_JSONP_onloadCount ) return;
                        // TODO callback が無ければ error
                        X_NET_JSONPWrapper[ 'asyncDispatch' ]( 1000, X_EVENT_ERROR );