mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 06:54:58 +00:00
Update app.js
This commit is contained in:
parent
db55b30106
commit
01f0ae6254
16
app.js
16
app.js
|
@ -172,17 +172,10 @@ var console = {
|
|||
if (typeof CreateObject === "undefined") {
|
||||
var CreateObject = function(progId, serverName, callback) {
|
||||
var progIds = (progId instanceof Array ? progId : [progId]);
|
||||
var _CreateObject = function(p, s) {
|
||||
if (typeof WScript !== "undefined") {
|
||||
return WScript.CreateObject(p, s);
|
||||
} else {
|
||||
return new ActiveXObject(p);
|
||||
}
|
||||
};
|
||||
|
||||
for (var i = 0; i < progIds.length; i++) {
|
||||
try {
|
||||
var obj = _CreateObject(progIds[i], serverName);
|
||||
var obj = CreateObject.make(progIds[i], serverName);
|
||||
if (typeof callback === "function") {
|
||||
callback(obj, progIds[i]);
|
||||
}
|
||||
|
@ -192,6 +185,13 @@ if (typeof CreateObject === "undefined") {
|
|||
};
|
||||
}
|
||||
};
|
||||
CreateObject.make = function(p, s) {
|
||||
if (typeof WScript !== "undefined") {
|
||||
return WScript.CreateObject(p, s);
|
||||
} else if (typeof ActiveXObject !== "undefined") {
|
||||
return new ActiveXObject(p);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user