0

I read somewhere that webpages should appear (mostly) intact even with Javascript disabled. In my page, I utilize Javascript to dynamically add a table to my page upon load. I was wondering whether there was any way to display a blank table aside from obnoxious

<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>

placeholder chains such as the above or otherwise hard-coding the default table values into the HTML.

4

1 回答 1

1

the <noscript> tag runs when javascript was disabled or not there.

<noscript>Your browser does not support JavaScript!</noscript>

there you can include the table. css can do that job too. set it as hidden by default but if no script, re-write css by setting it to display again, make sure this is below the css responsible for hiding it

here is a link for the non-script tag

http://www.w3schools.com/tags/tag_noscript.asp

also you shouldn't worry that much im saying because less than 2% of users are actually browsing with javascript off, and most of those are robots crawling

http://developer.yahoo.com/blogs/ydn/many-users-javascript-disabled-14121.html

<noscript>
<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
</noscript>
于 2013-09-02T23:49:44.377 回答