【发布时间】:2010-10-03 17:21:39
【问题描述】:
我正在使用 ASP.NET MVC 编写应用程序。与传统的 ASP.NET 相比,您更需要负责在生成的页面中创建所有 id。 ASP.NET 会给您提供令人讨厌但唯一的 ID。
我想添加一个快速的小 jQuery 脚本来检查我的文档是否有重复的 ID。它们可能是 DIVS、图像、复选框、按钮等的 id。
<div id="pnlMain"> My main panel </div>
<div id="pnlMain"> Oops we accidentally used the same ID </div>
我正在寻找一个 set and forget type 实用程序,它会在我做某事时发出警告。
是的,我只会在测试期间使用它,也欢迎替代品(例如 firebug 插件)。
【问题讨论】: