0
<span class="act-button"><input type="button" value="Deactivate" onclick="deactivateTemplate(' + options.rowId + ')"></span>
按钮,我需要onclick
后更改文本里面span.act-button
,
我试图用这个代码
function deactivateTemplate(id) {
$.post('@Url.Action("DeactivateFormTemplate")', { id: id })
.done(function (result) {
showMessage(result.Message);
$('span.act-button').empty().html('<input type="button" value="Activate" onclick="activateTemplate(' + options.rowId + ')">');
});
但点击我的按钮后,消失,我没有得到span.act-button
内的新按钮。
我的代码有什么问题?
几乎这段代码的每一行所引用的东西,我们不能看到。你确定这一切正如你所期望的那样一起工作吗?这些参考文献的结果值是什么?当你调试这个时,观察到的行为在什么时候偏离了预期的行为? – David
我在我的页面上获得了' 'span.act-button'变成空的,我没有在里面找到一个新的按钮。 – Heidel