我在静态 HTML 页面上成功使用了 JQuery editInPlace 插件。
当通过 Ajax 调用注入 HTML 时,它不能使用相同的 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
});
帮助将不胜感激。