r55253 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55252‎ | r55253 | r55254 >
Date:18:26, 18 August 2009
Author:werdna
Status:deferred (Comments)
Tags:
Comment:
Minor jQuery performance
Modified paths:
  • /trunk/extensions/LiquidThreads/lqt.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/lqt.js
@@ -166,10 +166,10 @@
167167 var elems = $j('.lqt-thread-toolbar-rhs');
168168
169169 elems.each( function(i) {
170 - var quoteButton = $j('<span></span>' );
 170+ var quoteButton = $j('<span/>' );
171171 quoteButton.className = 'lqt-header-quote';
172172
173 - var link = $j('<a href="#"></a>');
 173+ var link = $j('<a href="#"/>');
174174 link.append( wgLqtMessages['lqt-quote'] );
175175 quoteButton.append( link );
176176

Comments

#Comment by Simetrical (talk | contribs)   22:06, 20 August 2009

Ick, self-closing tags. People should stop using those when dealing with text/html, it makes people think they actually work.

#Comment by Nikerabbit (talk | contribs)   18:36, 22 August 2009

This is DOM/jQuery, not html. If it is a problem, please enlighten us.

#Comment by Simetrical (talk | contribs)   01:59, 23 August 2009

It will work fine, that's why I didn't mark this fixme. But I'd avoid using them in anything relating to text/html, because as I said, people will get used to the syntax and think it actually works. <span /> in almost any browser is the same as <span> in a normal HTML page, not <span></span>. But if you see this kind of syntax being used you might think otherwise. I did at one point, and I'm pretty sure I saw Tim did once too. It encourages confusion.

Status & tagging log