Un composant ActiveX ne peut pas créer un objet
Bonjour à tous.
Dans le but d’ouvrir des fichiers sur le post client avec du javascript, j’ai écrit ce petit code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>tb</title>
<script type="text/JavaScript">
function start(link)
{
if(link != "")
{
var obj= new ActiveXObject("WScript.Shell");
obj.Run("\""+link+"\"");
}
}
</script>
</head>
<body>
<input type="text" id="lien">
<button onclick="start(document.getElementById('lien').value)" >TEST</button>
</body>
</html> |
Le problème est que quand j’exécute ce fichier depuis mon pc => ça marche nikel
Mais quand je mets ce fichier (.html) sur le serveur puis j’essaye d’executer => Un composant ActiveX ne peut pas créer un objet
Quelqu’un sait pourquoi ?