【发布时间】:2016-07-13 17:55:11
【问题描述】:
我正在编辑一个 div 并尝试使用 url 在 div 中发送新文本,我不知道如何在 url 末尾附加新文本,我尝试了下面的方法没有成功。
$(document).ready(function() {
$('.edit').editable(function(value, settings) {
var $this = $("#edit").text();
$.ajax({
type: 'post',
url: "url"+$this,
success: function(event) {
console.log($("#edit").text());
}
});
return(value);
}
});
【问题讨论】:
-
呃,url 是你要发送数据的脚本的地址。
http://example.com/whatever.php,您正在尝试执行与http://example.com/whatever.phpOnce upon a time, blah blah等效的操作,这不是有效的 url。