I know it's easy to bypass javascript with the <script> tags, but I have some actual HTML I want to disable. Specifically, there is an html div with some stuff in it, and the main thing in it is a javascript thing. If a user has no javascript, I don't want the div box shown at all. I tried putting the whole box in a separate php file, and then using: <script type="text/javascript" src="separate.php"></script> Code (markup): but it didn't work. Any tips? Thanks!!
Yeah, that's what I finally did, put everything I wanted to say, html tags and all, in a big javascript output. Don't know why I had such a mental block against it! It took some character escaping and removal of tabs and linebreaks, but it works fine, check it out here: http://music-nerds.com/album.php?id=1910 It's the "Widget" box down the page; you won't see that box if you have javascript disabled. Thanks anyway MMJ!
np. The reason why the "whole box in a separate php file" solution didn't work is possibly because you weren't serving the page as javascript. To do so you would have to add this in the beginning: header('Content-type: application/javascript'); PHP:
Ah, didn't think of that. Thanks. Fortunately, what I needed was small, and the solution you mentioned before worked like a charm!