IEで奇妙な問題が発生しています。
私は持っています
tool==''ツール変数は空にすることができ、IEを幸せにする必要があるようです
。
//work in IE and other browsers..
if(tool==null || tool==''){Alert('bang!!!');}
//doesn't work in IE but not other browsers.
if(tool==null){Alert('bang!!!');}
何が起きてる?
IEで奇妙な問題が発生しています。
私は持っています
tool==''ツール変数は空にすることができ、IEを幸せにする必要があるようです
。
//work in IE and other browsers..
if(tool==null || tool==''){Alert('bang!!!');}
//doesn't work in IE but not other browsers.
if(tool==null){Alert('bang!!!');}
何が起きてる?
これを試して:
if( !tool ){
Alert('bang!!!');
}
ここでは、またはの場合!toolに戻ります。truetool = nulltool = ''
この記事: http ://saladwithsteve.com/2008/02/javascript-undefined-vs-null.html はそれを非常によく説明しています。
使用できますif(!tool) alert('bang');