Jeditable正在将数据保存到文件中,如下所示:
$('.edit_area').editable('http://www.example.com/save.php', {
type : 'textarea',
cancel : 'Cancel',
submit : 'OK',
indicator : '<img src="img/indicator.gif">',
tooltip : 'Click to edit...'
});`如何用admin-ajax.php替换JQuery.ajax?我是否只是将http://www.example.com/save.php替换为admin_url('admin-ajax.php')?
发布于 2012-02-08 14:59:25
我为我的问题找到了解决办法。此插件使用url格式,格式如下:
$('.edit_area').editable('<?php echo admin_url('admin-ajax.php'); ?>?action=youraction', {
type : 'textarea',
cancel : 'Cancel',
submit : 'OK',
indicator : '<img src="img/indicator.gif">',
tooltip : 'Click to edit...',
somekey : 'somevalue'
});`https://wordpress.stackexchange.com/questions/41463
复制相似问题