【发布时间】:2014-05-12 05:31:16
【问题描述】:
在将 PrototypeJS 转换为 jQuery 时遇到问题。我的原型 JS 是
function remove_invitation(target) {
if (confirm('Delete this invitation?')) {
$$('div#'+target+' input.hidden_delete')[0].setValue('1')
Element.hide(target);
}
}
我已经转换成jQuery了
function remove_chore(target) {
if (confirm('Delete this chore?')) {
$('div#'+target+'input.hidden_delete').first().val(1);
// $('div#'+target).hide();
$('div#'+target).css("display","none");
}
}
但它无法正常工作,因为它正在工作 PrototypeJS。
【问题讨论】:
-
它们都是 JavaScript。看起来您正在尝试将最初使用 PrototypeJS 库编写的代码转换为使用 jQuery。但这不会改变您使用的语言。
-
$('#'+target).hide().find("input.hidden_delete:first").val(1); -
@epascarello 谢谢。它有效。
-
@AmritdeepDhungana 我的回答对你有用吗?
标签: javascript jquery prototypejs prototype