0
基本上,我想這在JavaScript等效等價的JavaScript代碼:是什麼讓一個textarea,並通過本地計算機上的程序而無需刷新頁面運行它
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["comment"])) {
$comment = "";
} else {
$var1 = ($_POST["comment"]);
$comment = exec("any.exe $var1");
}
}
<textarea name="comment" rows="5" cols="40"></textarea>
<textarea id="target" cols="80" rows="4" readonly tabindex="99">
<?phpecho $comment;?>
</textarea>
我想它,所以它沒有按「T刷新頁面,到目前爲止,我有這樣的:
<script type="text/javascript">
function function_one(document.getElementById("source")){
MyObject= new ActiveXObject("WScript.Shell")
RunExe(){
MyObject.Run("file:///C:/path to/any.exe")
}}
document.ElementById("target").innerHTML = function_one();}
</script>
下面是HTML:
<textarea id="source" cols="80" rows="4" ></textarea>
<button onclick="function_one()">Click me</button>
<textarea id="target" cols="80" rows="4" readonly tabindex="99"></textarea>
any.exe有什麼作用?如果你可以用JavaScript重寫它,你的建議將是可能的。 –