开发者

Reload page after 'Jeditable' request

I'm submitting data using the jQuery plugin 'Jeditable' and that part is working fine. What I'm having trouble with is figuring out how and where to reload the page after the submission.

Here's the Jeditable code:

$('.addlist').editable('editsave.php', {
    indicator   : 'Adding...'开发者_StackOverflow中文版,
    tooltip     : 'Click to add...',
    onblur      : 'submit'
});

I've tried adding:

$('.addlist').click(window.location.reload());

After the previous code. However, that doesn't seem to work. I've also tried reloading using PHP but the page loads inside the editable div.

A simple solution would be greatly appreciated. Thanks :)


Try this:

$('.addlist').editable('editsave.php', {
    indicator   : 'Adding...',
    tooltip     : 'Click to add...',
    onblur      : 'submit',
    callback : function(value, settings) {
         window.location.reload();
    }
});

Here's the definition on the 'Jeditable' website:

(Function) callback: Function is called after form has been submitted. Callback function receives two parameters. Value contains submitted form content. Settings contain all plugin settings. Inside function this refers to the original element.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜