代码。点击运行不上。点击运行时,我有这样的:代码是不是超链接
$(".cancel").click(function() {
alert("got here");
$(this).closest(":dialog").dialog("close");
});
<a class="cancel" href=""><img src="images/cancelButton.gif" border="0" /></a>
它一定是愚蠢的东西,但我无法看到它。
重要的是要注意这里的“为什么”:没有“文档就绪”条件,目标链接在DOM中还不存在,不能由jQuery修改。 – 2010-04-15 14:26:27
是的,好点。我认为人们会忘记JavaScript一读完就运行,ready()命令实际上将其内容附加到documentIsNowFinishedLoadingIntoBrowserMemory事件中。 :-) – Armstrongest 2010-04-15 15:41:13