Tag Archives: browsers

jQuery: Change Doctype

There are a few things you might want to know if you’re looking to change the document type (doctype) using jQuery or Javascript. First, doctype is listed as a property in the W3C documentation, and is defined as read-only: interface Document : Node { readonly attribute DocumentType doctype; readonly attribute DOMImplementation implementation; readonly attribute Element documentElement; Element createElement(in DOMString tagName) raises(DOMException); DocumentFragment createDocumentFragment(); While it may be possible to insert a doctype with javascript / jquery above the HTML tag, it is not advisable to do so. Sample code which would do this might look like: <!– no doctype, loads in Quirks Mode (BackCompat) –> <html> <!– rest of the document, then at the end: –> <script> alert(‘now in compatMode ‘+document.compatMode); if (document.compatMode===’BackCompat’) { setTimeout(function() { var markup= document.documentElement.innerHTML; markup= ‘< !DOCTYPE html><html xmlns=”http://www.w3.org/1999/xhtml” lang=”en” xml:lang=”en”>’+markup+'</html>’; document.open(); document.write(markup); document.close(); }, 0); } </script> </html> via

Posted in Tech Tips, Web Development | Tagged , , , , , , | Leave a comment

Most Common User Agents

A dynamic, downloadable list of the most common user agents. Have you ever wondered what Most Common User Agents are? This is a list of the most common user agents, dynamically generated to remain accurate and up to date. Often times people will post a list on their site, which soon becomes outdated. So, I decided I would create a user agent list that is dynamically generated and updated- it uses data from my own website to keep the list of user-agent data up to date – which means the list stays up to date as new browsers are released and new user agents emerge. It is, in effect, a highly accurate representation of common useragents. Below you will find a table showing the most popular / most-used UserAgents and percentage of visitors who had that user-agent when they visited the site. And, as of May 2012 this page should now be even more dynamic with a new method for calculating a rolling average of visitors. Your user agent is: Last Updated: Sun, 27 Sep 2020 08:33:09 +0000 percentuseragentsystemuser_agent_string_md5 9.3%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36Chrome 85.0  Win104243c5bad934d66f978f6ee6e569fdad7.8%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36Chrome 85.0  Win100d7547ea912e3ce2a35572c8b9a755b15.9%Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0Firefox 80.0  Win10c51375c8235cfb78e537fdf97dea9e105.4%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36Chrome 84.0  Win1050f6bea7eecdc0cbebce3fe52b0016514.0%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36Chrome 84.0  Win10ef304b8034ec4ae3b449ff3aaae049f63.0%Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15Safari 13.1  macOSd4e252f9cf1badbf8d0f65373387d1233.0%Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) … Continue reading

Posted in Tech Tips, Web Development | Tagged , , , , , , , | 25 Comments