IEã®é«éåãã¯ããã¯
ITæ¦è¨ - ä¸è¡ã§ IE ã® JavaScript ãé«éåããæ¹æ³
ããããã«ãdocument ãªãã¸ã§ã¯ããå¤æ°ã«ç½®ãã¦ããã¨æ©ããªããã£ã¦ãã話ãªãã ãã©ãã©ãã«ããããç解ã§ããªãï¼ç´å¾ã§ããªãã§ã¯ãªãã¦ãæ¬å½ã«ç解ã§ããªãï¼ã
var doc = document; var document = doc;ã®ãããªãã¨ãåºæ¥ãã°ä¸çªããã®ã§ããããã
ãããã¾ãã JavaScript ã§ã¯å¤æ°ã¯ã¹ã³ã¼ãã®å é ã§çæãããããã document ã¯ç©ºã®å¤æ°ã¨ãªã undefined ã«ãªã£ã¦ãã¾ãã¾ãã
èªåã§ã試ãã¦ã¿ããã©ã undefined ã«ãªã£ã¦ãã¾ãã
å®é¨ã«ã¯ãæ®éã® HTML æ§é ã¨ã HEAD ã¿ã°å
㧠script ã¿ã°ã使ã£ã¦ JS ãè¨è¼ãã¦ã¿ãã
var doc = document
alert ã§ç¢ºèªãã¦ã¿ããã©ããã®æç¹ã§ã¯ doc ã document ã object ã¨è¡¨ç¤ºãããã
var doc = document var doucment = doc
ããããã¨ã doucment ã doc ã undefined ã«ãªã£ã¦ãã¾ãã
ä½æ
ã ããã2è¡ç®ã®æç¹ã§ã® doc ã undefined ã«ãªã£ã¦ããã®ãï¼ãâ¦â¦ãããããã(´Ð`)
JSã®ã¹ã³ã¼ãã®æ¦å¿µãããã£ã¦ãªãããç解ã§ãã¦ããªãã®ã ãã¼ãã
ã³ã¡ã³ãæ¬ã人æ°ã®ãããªã®ã§
è¦ãããããã«æ¬æã¸ç§»åãã¦ããã
ã¨ãããããæ°æ°ãï¼
> ãããã¾ãã JavaScript ã§ã¯å¤æ°ã¯ã¹ã³ã¼ãã®å é ã§çæãããããã document ã¯ç©ºã®å¤æ°ã¨ãªã undefined ã«ãªã£ã¦ãã¾ãã¾ãã
ä¾ãã° var foo = 1, bar = 2; var foobar = foo + bar; ãªãã¦ãã宣è¨ããã£ãå ´åã
var foo = bar = foobar = undefined; //宣è¨ãããå¤æ°ã¯ã¹ã³ã¼ãã®æåã«å ¨é¨ã¾ã¨ãã¦çæãããã
foo = 1; bar = 2; foobar = foo + bar;
ã¿ããã«è§£éããã¾ãããªã®ã§
var doc = document; var document = doc; ã¯
var doc = document = undefined; doc = document; document = doc;
ã«ãªã£ã¦ undefined ã«ãªããã§ããã> 2è¡ç®ã®æç¹ã§ã® doc ã undefined ã«ãªã£ã¦ããã®ãï¼
var document; ãããæç¹ã§ããã®ã¹ã³ã¼ãã«å ¥ã£ãç¬éã« document ã undefined ã«ãªãããã§ãã
ã¨ãå ¨ç¶é¢ä¿ãªãéããããã§ããã
ä½è³ãªããã§ããããããã¾ããããããã¨ããããã¾ãï¼