0

我对 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 函数不起作用......?

4

0 回答 0