【发布时间】:2012-06-13 02:10:48
【问题描述】:
我有一个示例代码: 在 default.php 中:
<?php
JHTML::_('behavior.mootools'); /* to load mootools */
$ajax = "
/* <![CDATA[ */
window.addEvent('domready', function() {
$('start_ajax').addEvent('click', function(e) {
e.stop();
var url = 'index.php?option=com_xxx&controller=xxx&task=updateAjax&format=raw';
var x = new Request({
url: url,
method: 'post',
onSuccess: function(responseText){
document.getElementById('ajax_container').innerHTML = responseText;
}
}).send();
});
})
/* ]]> */
" ;
$doc = &JFactory::getDocument();
$doc->addScriptDeclaration($ajax);
?>
和我使用代码的default.php控制器:
function updateAjax() {
echo date('Y-m-d D H:i:s');
}
当我运行代码时出现错误undefined method JDocumentRaw::addCustomTag(),如何解决?
【问题讨论】: