So I recently discovered that I could use <>...</>
tags in javascript in Firefox, which is handy when defining blocks of HTML or CSS.
GM_addStyle(<><![CDATA[
.page { display: block }
/* ... */
td { vertical-align: top }
]]></>);
//...
div.innerHTML = <><![CDATA[
<table class="section">
<!-- ... -->
</table>
]]></>;
But I'm not exactly sure what's going on, and I like understanding the syntax that I'm using. What exactly does <>...</>
return? I noticed that the escaping works better when I enclose the contents in <![CDATA[...]]>
, so what's happening there? Is this Firefox only, or cross-browser?
I tried to look this up online, but ran into the normal google/symbol issue. Plus, most of the results for google CDATA javascript didn't seem relevant.