0
與此原型代碼等效的jQuery會是什麼?JQuery等價於原型代碼
如果你不認爲這是相關的並關閉它,你會介意直接用解決方案給我發消息嗎?
var comment_link = new Element('a', {
'title': "View snapshot",
'id': snapshot.id + '_comment',
'href': "#",
'class': ""
}).update(snapshot.name.truncate(13));
comment_link.observe('click', respondToClick);
comment_link.observe('mouseover', respondToMouseOver);
comment_link.observe('mouseout', respondToMouseOut);
我想這無濟於事:
var comment_link = new $j('<a/>', {
title: "View snapshot",
id: snapshot.id + '_comment',
href: "#",
class: ""
}).html(snapshot.name.truncate(13));
$j(comment_link).click(respondToClick);
$j(comment_link).mouseover(respondToMouseOver);
$j(comment_link).mouseout(respondToMouseOut);
有上所以沒有DM;)此外,您可能想告訴我們一些情況下... – vzwick