View Full Version : Load different HTML based on broswer

05-05-2008, 09:35 PM
I currently am using Javascript to load different CSS files to apply to a page depending on whether or not someone is using Firefox. But what I would like to do is have the script instead load entirely different html onto the page based on this same condition without having to make a document.write for every line of code. Is that possible?

I've played with it a tad, but I'm still not too well versed in JS, and so I haven't found anything that seems to me like it'd work aside from having a crapload of document.write 's.

05-06-2008, 03:04 AM
I think ideally this is what the server is for. But I don't know that it would be best to serve different HTML/browser. Might be better to work out incompatibilities and serve out the same. Even the small screen devices now allow notepad-like finger sliding of the entire window.

You can selectively shut things off, perhaps, in context. Let's say you have full-screen pages with navigation, but you also have the option of showing these same pages in an iframe. In the iframe, you might want to hide the nav bar. Something like that.