Hi, > More & more plugins are using CSS to style the layout, this is good, > but their didn't aware of if user browser don't know javascript, it is > useless to load the CSS, e.g. thickbox > > <script type="text/javascript" src="path-to-file/thickbox.js"></ > script> > <link rel="stylesheet" href="path-to-file/thickbox.css" type="text/ > css" media="screen" /> > > can be better: > > <script type="text/javascript" src="path-to-file/thickbox.js"></ > script> > <script> > document.write('<link rel="stylesheet" href="path-to-file/ > thickbox.css" type="text/css" media="screen" />'); > </script>
Most userse do have JS active. The overall overhead in bytes downloaded for thickbox.css where it is not needed is smaller than the overhead of bytes you introduce with your additional script tag for all users. In most cases it is better to load the unused stylesheet. Christof