【发布时间】:2012-04-05 14:20:51
【问题描述】:
我在静态 HTML 页面上成功使用了 JQuery editInPlace 插件。
当 HTML 由 Ajax 调用注入时,它不能使用相同的 HTML。
我知道使用 .on() 例如 '$('.edit_inplace_field').on(...)' 应该有助于解决问题,但我不确定应该如何针对这个特定的插入。
插件:http://code.google.com/p/jquery-in-place-editor/
工作的静态 HTML 代码如下所示:
<p id="name_id" style="background-color: transparent;
"class="edit_inplace_field">Enter Name</p>
与静态 HTML 一起使用的关联脚本:
$('.edit_inplace_field').editInPlace({
callback: function(unused, enteredText) { return enteredText; },
// url: './server.php',
show_buttons: false
});
我们将不胜感激。
【问题讨论】: