onerrorã§ã¨ã©ã¼ãæ¤åº
@nitoyon IE 6 ã¨ã©ã¼ã«ãªãï¼ãã¹ã¼ãæå ã« Windows ããªãã¼ãã¡ãã£ã¨å¥ã®ãã·ã³èµ·åãã¦ãã¾ãã
http://twitter.com/amachang/statuses/191685642
ã£ã¦ã®ããã£ãã®ã§onerrorã使ã£ãã¨ã©ã¼ã®æ¤åºæ¹æ³ã«ã¤ãã¦æ¸ãã¦ã¿ããã¨æãã¾ãã
ãããªãã½ã¼ã¹ã³ã¼ã
var err = function(a,b,c){ var img = new Image(); img.src = 'http://example.com/error.gif?a=' + escape(a) + '&b=' + escape(b) + '&c=' + escape(c); return true; } window.onerror = err;
ç¨æãããã®
- ä¸ã®ã¹ã¯ãªãããã§ããã ããã¼ã¸ã®ä¸é¨ã«è¨ç½®
- ã¢ã¯ã»ã¹ãã°ãé²è¦§ã§ããå ´æã«1x1ã®error.gifãç¨æ
access_logã«ã¨ã©ã¼ãã°ãè½ã¡ã¦ãã¾ã
[07/Aug/2007:22:55:53 +0900] "GET /error.gif?a=missing%20%3B%20before%20statement&b=http%3A//holy-grail.jp/work/javascript/error/&c=23 HTTP/1.1" 304 - "http://holy-grail.jp/work/javascript/error/" "Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"
ãã°ã®å 容ã¯
a | ã¨ã©ã¼ã®å 容 | missing ; before statement |
---|---|---|
b | ã¨ã©ã¼ãèµ·ããå ´æ | http://holy-grail.jp/work/javascript/error/ |
c | ã¨ã©ã¼ãçºçããè¡ | 23 |
ã£ã¦ãªæãã§ãã
ãã°ã«ã¯UserAgentãè½ã¡ãã®ã§ããã§ã¨ã©ã¼å¯¾çã¯ã°ã£ã¡ãã§ããï¼
ã¦ã¼ã¶ã«ãã¨ã©ã¼ã®ã¢ã©ã¼ãã表示ãããªããªãã®ã§è£å´ã§ãã£ããä¿®æ£ã¨ããã§ããããã«ãªã£ã¡ããã¾ãï¼ï¼
ã¡ãªã¿ã«å ãã¿ã¯
http://www.yahoo.com/
ã®ãã¼ã¸ã®ä¸é¨ã«
var ver="501"; var frcode="yfp-t-501";function err(a,b,c) { var img=new Image; img.src='http://srd.yahoo.com/hp5-v'+ver+'-err/'+escape(a)+','+escape(b)+','+escape(c)+'/*1'; return true; } window.onerror=err;
ã£ã¦ã®ãããã¾ãã
ãã®è¾ºãåèã«ã¨ã©ã¼å¯¾çããã¦ã¿ãã®ãããããããªãã§ããããï¼