Skip to content

{ Category Archives } javascript

IE Javascript problem?

What would you expect the bit of javascript below to do? <html> <body> <select id="testing"> </select> <script> var testing = document.getElementById(‘testing’); var georgeOpt = new Option("George", 1); testing.options[testing.length]=georgeOpt; var paulOpt = new Option("Paul", 2); testing.options[testing.length]=paulOpt; var johnOpt = new Option("John", 3); testing.options[testing.length]=johnOpt; var ringoOpt = new Option("Ringo", 4); ringoOpt.selected = true; testing.options[testing.length]=ringoOpt; </script> </body> </html> […]

Onbeforeunload throwing errors in IE – coding around it in ASP.NET

Some of the most popular questions on any web dev forum are: How do I trap the back button / stop people from clicking back? How do I stop someone from viewing source? How do I stop someone from closing a window/browser? Short answer for all is: you can’t! Especially if you are supporting multiple […]