我对renderPartial的JS和CSS注册感到有点生气。我有一个问题,我有以下观点:
<div id="data"></div>
<div id="dayData"></div>
然后我在页脚中有以下脚本:
$.ajaxSetup({async: false});
$("#currentdate").html(date.toString('MM.yyyy'));
$.post('userDeployment/shippingDeploymentCalendar', {date: date.toString('yyyy-MM-dd'),YII_CSRF_TOKEN:token}, function(data) {
var ni = document.getElementById('data');
ni.innerHTML = data;
});
function calendarItemClicked(id) {
$("table#calendar td.calendar-current-day").addClass("calendar-day");
$("table#calendar td.calendar-current-day").removeClass("calendar-current-day");
$("table#calendar td#"+id).addClass("calendar-current-day");
if(id<10)
id = "0"+id;
$.post('userDeployment/shippingDeploymentDay', {date: date.toString('yyyy-MM')+"-"+id,YII_CSRF_TOKEN:token}, function(data) {
$("#dayData").html(data);
var details = $("table#calendar td#"+id+" div.calendar-text").text();
var substr = details.split(' / ');
$("#dayDetails").html(need+": "+substr[1]+"<br/>"+planned+": "+substr[0]);
});
}
现在当页面加载时,一切看起来都不错,但是JQuery不起作用?当我将ni.innerHTML = data;
更改为$('#data').setHTML(data);
时 - 它再次起作用,但此HTMl中的另一个JQuery函数不起作用......?