JavaScriptlocation.hrefã«javascipt:ããå§ã¾ãæååãè¨å®ãããã¨ã§ãä»»æã®ã¦ã£ã³ãã§evalãè¡ããã location.href='javascript:var value=10;void(0);' alert(window.value); // 10 ä¸è¨ã³ã¼ãã¯ãIE 7ã¨Firefoxã§åä½ãããIE 6ã§ã¯ãlocation.hrefã¯ã¹ã¯ãªãããåæ¢ããã¨ãããalertãpromptã§å²ãè¾¼ã¿ãå ¥ã£ãã¨ãã«ãªããªãã¨å®è¡ãããªãããã§ãç´å¾ã«å¤ãåå¾ãããã¨ãã¦ãæªå®ç¾©ã¨ãªã£ã¦ãã¾ããã¾ããOperaã§ãæªå®ç¾©ã¨ãªã£ãã Firefoxã§ã¯ãObject#evalãæ®ã£ã¦ãããããwindow.evalã({}).evalã§evalã®å®è¡ã³ã³ããã¹ããå¤æ´ãããã¨ãã§ãããIEã§ãeval.call(window, expression)ã«ã
{{#tags}}- {{label}}
{{/tags}}