我无法取消设置搜索过滤器上使用的会话变量。单击domain.com/index.php?filter=clear时没有任何操作,并且未清除过滤器。
我使用php和JS的混合来使用AJAX更新表
PHP:
/**
* Clears the current filter
*/
function clear()
{
unset($_SESSION['filter']);
// Clear current page
unset($_SESSION['arctic_page']);
}
}
JS:
clear: function()
{
// Show loading image
new Element('img', { src: '/images/loading.gif' }).setStyle('float', 'right').injectTop(Issues.container.getElement('h2'));
// Create AJAX request
new Ajax('index.php',
{
method: 'get',
data: 'ajax=true&filter=clear',
update: 'issue_list',
onComplete: Issues.initialise
}).request();
}
答案 0 :(得分:0)
它看起来像原型JS,对吗?对我来说已经有一段时间了,但我认为这是正确的语法:
new Ajax.Request('index.php',
{
method: 'get',
data: 'ajax=true&filter=clear',
update: 'issue_list',
onComplete: Issues.initialise
});