Many Internet Web sites contain JavaScript, a scripting programming language that runs on the web browser to make specific features on the web page functional. If JavaScript has been disabled within your browser, the content or the functionality of the web page can be limited or unavailable. This article describes the steps for enabling JavaScript in web browsers. More InformationInternet ExplorerTo allow all websites within the Internet zone to run scripts within Internet Explorer:
To allow scripting on a specific website, while leaving scripting disabled in the Internet zone, add the specific Web site to the Trusted sites zone:
Google ChromeTo enable JavaScript in Google Chrome, please review and follow the instructions provided at Enable JavaScript in your browser to see ads on your site. Mozilla Corporation’s FirefoxTo enable JavaScript in Firefox, please review and follow the instructions provided at JavaScript settings for interactive web pages. Javascript를 이용해 어떤 브라우저로 application에 접속했는지에 대한 정보를 확인할 수 있다. 이때 사용되는게 User-Agent이다. 개발자 도구에서도 확인해 볼 수 있다. 이런 User-Agent 정보를 이용해 Javascript에서는 클라이언트로부터 온 요청을 브라우저에 따라 처리할 수 있다. 그럼 일단 User-Agent 가 브라우저에 따라 어떤 모습인지 알아야 한다. browserUser-AgentIEMozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like GeckoEdgeMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 Edg/94.0.992.50ChromeMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36FireFoxMozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0이런 특색이 있는 키워드가 있으니 이걸로 분기처리를 하면 된다.
이런식으로 작성하면 된다. 다른 브라우저를 사용한다면 추가를 해주면 된다. 기타 브라우저는 staroffice, webtv, beonex, chimera, netpositive, phoenix, skipstone, netscape 등이 있다. 끝! |