php - How to use txt content to onclick="doAjaxCall(' ')? -
i use voice xml select logo or movie. put logo.svg
or movie.php
in txt
file. use php load logo.svg
or movie.php
$thedata
.
<?php ini_set("display_errors", true); // define file name variable $myfile = "voice.txt"; // file handle file: 'r' means set permission read $fh = fopen($myfile, 'r'); //read entire file , store contents in variable $thedata $thedata = fread($fh, filesize($myfile)); // close file ok use later fclose($fh); //echo whatever in file browser echo $thedata; // part 2 // file handle file: 'a' means set permission read $fh = fopen($myfile, 'w') or die("error trying open a"); $nodata = "no msgs"; //read entire file , store contents in variable $thedata $thedata = fwrite($fh, $nodata); // close file ok use later fclose($fh) ?>
now want show either of them on webs. use:
<input class="logo" type="button" value="call (832) 271-6319 " onclick="doajaxcall(' ');"/>
how can it? should use javascript?
i'm not sure want achieve. onclick allows add javascript function
<input onclick="myfunction()" />
you can make ajax call function. or can use jquery , attach function input click event.
$(".logo").click(function(){ ..... });
Comments
Post a Comment