我有一个带有 php if 语句的 php 文件,它为 mySQL 表名生成一个 php 会话变量。我需要访问的这个表名是一个javascript文件demo.js。任何想法都会很棒。
PHP 代码片段:
$fcyclestartdate = $_POST['CycleStartDate'];
$fcycleenddate = $_POST['CycleEndDate'];
$_SESSION["paycycletable"] = "PCR_".str_replace("-", "", $fcyclestartdate)."_".str_replace("-", "", $fcycleenddate);
js文件代码截图:
function DatabaseGrid()
{
this.editableGrid = new EditableGrid("demo", {//Variable table name must go where "demo" is
enableSort: true,
// define the number of row visible by page
pageSize: 50,
// Once the table is displayed, we update the paginator state
tableRendered: function() { updatePaginator(this); },
tableLoaded: function() { datagrid.initializeGrid(this); },
modelChanged: function(rowIndex, columnIndex, oldValue, newValue, row) {
updateCellValue(this, rowIndex, columnIndex, oldValue, newValue, row);
}
});
this.fetchGrid();
}