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' )
} );
// http://d.hatena.ne.jp/cnrd/20080518/1211099169
// 最近の仕様変更(引数のtargetOriginとかMessageEventのoriginとか)にはまだ対応してないみたい
- if( X_UA.Opera ){
+ if( X_UA[ 'Opera' ] ){
html = [
( window[ 'JSON' ] ? '' : '<script src="' + json2Path + '"></script>' ),
'<script>',
];
X_Net_JSONP_onloadCount = 2;
} else
- if( X_UA.IE8 ){
+ if( X_UA[ 'IE8' ] ){
html = [
// JavaScriptでunicode文字列をunescapeする
// http://perutago.seesaa.net/article/202801583.html
];
X_Net_JSONP_onloadCount = 2;
} else
- if( X_UA.IE9 ){
+ if( X_UA[ 'IE9' ] ){
html = [
'<script id="jp"></script>',
'<script>',
];
X_Net_JSONP_onloadCount = 1;
} else
- if( X_UA.IE4 || X_UA.MacIE ){
+ if( X_UA[ 'IE4' ] || X_UA[ 'MacIE' ] ){
html = [
'<script id="jn"></script>',
'<script id="jp"></script>',
];
X_Net_JSONP_onloadCount = 3;
} else
- if( X_UA.IE < 8 ){ // ie5-7
+ if( X_UA[ 'IE' ] < 8 ){ // ie5-7
html = [
'<script id="jn"></script>',
'<script id="jp"></script>',
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();