TypeNameã§Interfaceå(ãã©ã)ãåå¾ãã
ã¯ããã«
VBScriptã®TypeName()é¢æ°ã¯å¤æ°ã¯ãã®å¤æ°ãã©ããªåãªã®ããè¿ãã¦ãããé¢æ°ã§ãã
ããã¯scriptè¦ç´ ãtext/vbscriptãªãã°ä½¿ããã®ã§ãããåºæ¥ãã°JavaScriptã§ä½¿ãããã£ã¦è©±ã§ãã
window.execScript()ã«ã¤ãã¦
å®ã¯ãããªã¡ã½ãããwindowãªãã¸ã§ã¯ãã«ããã¾ããã
window.execScript(sExpression, sLanguage)
ããããæãã§ä½¿ãã¾ãã
VBScriptãJavaScriptã§å¼ã³åºãããåºæ¥ã
ãããªæãã§ãã
if (window.execScript) { window.execScript('Function xTypeName(x): xTypeName = TypeName(x): End Function', 'VBScript'); }
ãããããã¯ãã¼ã¯ã¬ããã«ãããªãã°ã
javascript:if(window.execScript){window.execScript('Function xTypeName(x): xTypeName = TypeName(x): End Function', 'VBScript');}
使ã£ã¦ã¿ãã
alert(xTypeName(window)); // HTMLWindow2 alert(xTypeName(document)); //HTMLDocument alert(xTypeName(document.documentElement)); // HTMLHtmlElement alert(xTypeName(document.getElementsByTagName("*"))); // DispHTMLElementCollection alert(xTypeName(document.documentElement.attributes)); // DispHTMLAttributeCollection
ã¨è¨ãæãã§ãªãã¸ã§ã¯ãåãåãã¡ããã¾ããOleViewã¨å ±ã«èª¿ã¹ã¦ã¿ãã¨çµæ§é¢ç½ãã§ãã