开发者

Reload page after 'Jeditable' request

开发者 https://www.devze.com 2023-03-03 15:59 出处:网络
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.

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

精彩评论

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

关注公众号