Note that there are some explanatory texts on larger screens.

plurals
  1. POcall php function repeatly in javascript
    primarykey
    data
    text
    <pre><code>function getTime() { var date = new Array( &lt;?php $date1 = date("Y-m-d, H:i"); echo "new Array(\"".$date1."\")"; ?&gt;); //document.write(date[0]); return date[0]; } function showmychart() { max_time = getTime(); min_time = getMintime(max_time); //document.write(max_time); //delete myChart; var c_channel = channel; myChart = new Drawchart(max_time, min_time,c_channel); myChart.showChart(); } function changeSBS(){ channel = 'sbs'; showmychart(); } function changeKBS2(){ channel = 'kbs2'; showmychart(); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;center&gt; &lt;div id = "header"&gt; &lt;/div&gt; &lt;div id="middle"&gt; &lt;input type = "button" id ="before" onclick="showBeforeChart();" value = "Before"&gt; &lt;object id="chart"&gt;&lt;/object&gt; &lt;script class="code" id="Drawchart" type="text/javascript"&gt;showmychart();&lt;/script&gt; &lt;input type = "button" id ="after" onclick="showAfterChart();" value = "After"&gt; &lt;/div&gt; &lt;div id = "channel_position"&gt; &lt;input type = "button" id ="before" onclick="changeSBS();" value = "aaa"&gt; &lt;input type = "button" id ="before" onclick="changeKBS2();" value = "bbb"&gt; </code></pre> <p>in this code, when i click aaa button or bbb button I want to update max_time in function shomychart() using function getTime(). Now, when I click the button aaa, and bbb it doesn't update, i think it doesn't call getTime() function or in the getTime() function doesn't work... How can i solve this problem???? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload