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調用。 –