Now IE crashes immediately. Writing Cross-Browser Code To avoid this, we determine which browser we are running, and then use this information. We have to adapt the appName code slightly to detect the browser. IE reports M, NN reports N . Now the code runs in both browsers.
Some people prefer the page selection technique when they write cross-browser code.
This involves sending the viewer to the page that has been written for their browser. This code can prove easier to debug and maintain. This technique would use three pages instead of one. The first redirects the viewer to an appropriate page. Then we have two distinct pages for each browser.