0
我用语音XML来选择标志或电影。把logo.svg
或movie.php
在txt
文件,然后我用PHP来加载logo.svg
或movie.php
到$theData
。如何使用TXT内容的onclick =“doAjaxCall(”“)?
<?php
ini_set("display_errors", true);
// define your file name as a variable
$myFile = "voice.txt";
// get a FILE HANDLE to the file: 'r' means set permission to read
$fh = fopen($myFile, 'r');
//read the entire file and store the contents in the variable $theData
$theData = fread($fh, filesize($myFile));
// close the file so it will be OK to use later
fclose($fh);
//echo whatever is in the file back to the browser
echo $theData;
// PART 2
// get a FILE HANDLE to the file: 'a' means set permission to read
$fh = fopen($myFile, 'w') or die("Error trying to open with a");
$noData = "no msgs";
//read the entire file and store the contents in the variable $theData
$theData = fwrite($fh, $noData);
// close the file so it will be OK to use later
fclose($fh)
?>
现在我想告诉他们要么对网 我使用:??
<input class="logo" type="button" value="Call (832) 271-6319 " onclick="doAjaxCall(' ');"/>
我怎样才能做到这一点我应该使用JavaScript
我用这个在HTML <输入类= “标志” 类型= “按钮” 值= “调用(832)271-6319” 的onclick = “doAjaxCall( 'movie.php');”/> – vivian
我不明白你想达到什么。 onclick允许你添加一个javascript函数。你可以用这个函数进行ajax调用。 –