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: Fri, 23 Apr 2021 12:17:40 +0000 percentuseragentsystemuser_agent_string_md5 9.5%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36Chrome 89.0  Win1072766ab2b1c85af98adbbb9683600fdf9.2%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36Chrome 89.0  Win1083f75fe8d5c2f40c243760c04f60cc4e7.3%Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0Firefox 87.0  Win1066ec6a80fa7013fddb1e67d9da0622a84.4%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36Chrome 89.0  Win10430c8bfe8bf1cc772d8a7ec27f27106c3.9%Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15Safari 14.0  macOSfde6b5e09d017489a44967c1846dcc292.4%Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0Firefox 78.0  Win10777454e8ade1f7836a76bbf9d8e2997d2.3%Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0Firefox 87.0  Linux86dc7e2a935bdd198ad5a4421bfaa4211.9%Mozilla/5.0 (Macintosh; Intel Mac OS … Continue reading

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