我在 javascript 和 jquery 中使用 nubie。我想改变我的“tipe”<-(变量)槽组合框的值
这是脚本:
tipe = 'report-reg'; //this var that i wanna change
$(document).ready(function () { //this is javascript for chart
// prepare the data
var theme = 'classic';
var source =
{
datatype: "json",
datafields: [
{ name: 'reqtime', type: 'date'},
{ name: 'jumlah'}
],
url: 'include/data_chart/data-reg-day.php?type='+tipe //tipe load value from combobox
};
这是组合框 html:
<form method="get" action="" name="combobox">
<div>
<select id="combobox" name="combo-box" onchange="tipe=this.value">
<option>Select report tipe</option>
<option value="report-reg-perday">Per-day Report</option>
<option value="report-reg-perweek">Per-week Report</option>
<option value="report-reg-permonth"> Per-Month Report</option>
</select>
<div style="width:100%; height:500px" id="jqxChart"></div>
</div>
</form>
对不起,如果我的帖子乱七八糟。非常感谢。