Disabling browser print options (headers, footers, margins) from page?

I have seen this question asked in a couple of different ways on SO and several other websites, but most of them are either too specific or out-of-date. I’m hoping someone can provide a definitive answer here without pandering to speculation. Is there a way, either with CSS or javascript, to change the default printer … Read more

What are all the valid self-closing elements in XHTML (as implemented by the major browsers)?

What are all the valid self-closing elements (e.g. <br/>) in XHTML (as implemented by the major browsers)? I know that XHTML technically allows any element to be self-closed, but I’m looking for a list of those elements supported by all major browsers. See http://dusan.fora.si/blog/self-closing-tags for examples of some problems caused by self-closing elements such as … Read more

How do I render a Word document (.doc, .docx) in the browser using JavaScript?

I have successfully done code to display a PDF file in the browser instead of the “Open/Save” dialog. Now, I’m stuck trying to display a Word document in the browser. I want to display a Word document in Firefox, IE7+, Chrome etc. Can any one help? I am always getting the “Open/Save” dialog while displaying … Read more

How can I determine what font a browser is actually using to render some text?

My CSS specifies “font-family: Helvetica, Arial, sans-serif;” for the whole page. It looks like Verdana is being used instead on some parts. I would like to be able to verify this. I’ve tried copying and pasting from my browser into Word, but it’s not preserving the font. Is there some way to determine which font … Read more

How can I stop the browser back button using JavaScript?

I am doing an online quiz application in PHP. I want to restrict the user from going back in an exam. I have tried the following script, but it stops my timer. What should I do? The timer is stored in file cdtimer.js. <script type=”text/javascript”> window.history.forward(); function noBack() { window.history.forward(); } </script> <body onLoad=”noBack();” onpageshow=”if … Read more