JavaScriptはdllの公用方法を呼び出します.
954 ワード
<script language="JavaScript">
//JavaScript dll
//appName dll (dll ) + dll
//methodName dll
function run_dll(appName, methodName){
window.oldOnError = window.onerror;
window._command = appName;
window.onerror = function(err) {
if (err.indexOf('Automation') != -1) {
//alert(' ' + window._command + '
\r
\r !');
alert(' , ');
window.open('http://www.baidu.com/');
return true;
} else {
return false;
}
};
var obj = new ActiveXObject(appName);// dll + dll
var result = obj[methodName](); //dll
alert(result);
}
</script>
<button onclick="run_dll('pubStream.pubCore','onGetVersion')"> dll </button>