我希望能够在我的文档中的任何位置放置一个空标记作为jQuery可以解决的标记。 但是,重要的是XHTML仍然有效。
为了给你一些关于我正在做什么的背景知识:我已经比较了特定文档的当前版本和以前版本,并且我在html中放置了差异所在的标记。 然后我打算使用jQuery突出显示父块块级元素,当highlightchanges=true在URL的查询字符串中时。
目前我正在使用<span>标签,但我发现这种事情无法验证:
<table> <tr> <td>Old row</td> </tr> <span class="diff"></span><tr> <td>Just added</td> </tr> </table>那么我可以在任何地方使用标签吗? Meta标签可能吗?
谢谢你的帮助!
伊恩
编辑:根据codeka的建议,我可能会寻找一个更好的差异引擎,我可能找到了一个适合在XHTML中找到差异的引擎: http : //www.rohland.co.za/index.php/2009/10 / 31 / CSHARP-HTML的Diff-算法/
I would like to be able to place an empty tag anywhere in my document as a marker that can be addressed by jQuery. However, it is important that the XHTML still validates.
To give you a bit of background as to what I'm doing: I've compared the current and previous versions of a particular document and I'm placing markers in the html where the differences are. I'm then intending to use jQuery to highlight the parent block-level elements when highlightchanges=true is in the URL's query string.
At the moment I'm using <span> tags but it occurred to me that this sort of thing wouldn't validate:
<table> <tr> <td>Old row</td> </tr> <span class="diff"></span><tr> <td>Just added</td> </tr> </table>So is there a tag I can use anywhere? Meta tag maybe?
Thanks for your help!
Iain
Edit: On the advice of codeka, I may look for a better difference engine and I may have found one that is attuned to finding differences in XHTML: http://www.rohland.co.za/index.php/2009/10/31/csharp-html-diff-algorithm/
最满意答案
您可以使用HTML注释和此插件 (或此 插件 )。
You can use HTML comments and this plugin (or this one).
更多推荐
发布评论