0
我正在創建一個報告,報告參數的界面和報告本身都是由完全相同的php文件創建的。Ajax.Request顯然不評估JS代碼
這被稱爲文件的部分的第一線正在創建報表時:
<script type="text/javascript">alert("bla");</script>
每當我使用此代碼摳報告
new Ajax.Updater('reportarea','reportengines/<?=$configdata['filename']?>',
{
method: 'post',
parameters: {
action: 'executereport',
rep_projects: $('rep_projects').value,
rep_daterange: $('rep_daterange').value,
rep_daterangefws: $('rep_daterangefws').value,
rep_daterangemos: $('rep_daterangemos').value,
start_date: startdate,
end_date: enddate
}
}
)
一切完美和我的所有JS代碼都會在頁面打開後立即進行評估,但警報會顯示「bla」,但如果我使用此代碼:
new Ajax.Request('reportengines/<?=$configdata['filename']?>',
{
method: 'post',
parameters: {
action: 'executereport',
rep_projects: $('rep_projects').value,
rep_daterange: $('rep_daterange').value,
rep_daterangefws: $('rep_daterangefws').value,
rep_daterangemos: $('rep_daterangemos').value,
start_date: startdate,
end_date: enddate
},
onSuccess: function(transport) {
$('reportarea').innerHTML = transport.responseText;
Effect.BlindUp('reportoptions', { duration: 1.0 });
Effect.BlindDown('reportarea', { duration: 1.0 });
}
}
)
甚至沒有顯示出絲毫的JS活動量。我可能會以錯誤的方式使用Ajax.Request,但我不明白哪一個...
是否有人對此有所瞭解?
這兩個選項需要一個單獨的請求只是爲了JS,不是嗎? 任何想法爲什麼我的代碼與Ajax.Updater,但與Ajax.Request沒有好? – Ferfish 2010-08-09 12:35:23
沒有額外的要求來評估JS – 2010-08-09 13:45:50
Ooops,我的壞,我沒有看到evalJS選項設置...它的工作完美。我仍然不知道它爲什麼不autoEval我的JS代碼。無論如何!謝謝! – Ferfish 2010-08-23 16:17:32