Skip navigation
artdaw

nbsp breaks AJAX

Posted by artdaw Jan 14, 2011

Yep, it's true! If you want to re-render a table with AJAX and your table contains "empty" TDs with nbsp inside you will be surprised that something goes wrong. Well, what is nbsp and why is it so popular?

nbsp is the entity used to represent a non-breaking space. If you need to have an empty cell in a table you probably will used nbsp.

Fine, we know that it is just entity, it is defined in DTD!

However XMLHttpRequest object has no idea about DTD and as the result it cannot parse nbsp.

Answer: use unicode numeric character references of non-breaking space:   or  

artdaw

rowspan="0" is special

Posted by artdaw Jan 14, 2011

It was sudden for me that rowspan has a special value '0'. It tells browser to span the cell to the last row of the table section such as tbody, thead, or tfoot regardless of rows amount. Maybe it is really cool sometimes but this feature is supported in Opera and Firefox only and causes bugs in real. So, please, avoid rowspan="0"

Filter Blog

By date: By tag: