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, 01 Aug 2021 05:24:17 +0000 percentuseragentsystemuser_agent_string_md5 16.1%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36Chrome 91.0  Win107f65ff317c237641f7aace3b7dac03d67.2%Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36Chrome 91.0  macOSd3581de507ceb29c498f509f31ea7f505.3%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36Chrome 92.0  Win10d4f10de547cb9cf96c32dc2e2c1a7bd25.0%Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0Firefox 89.0  Win10547158c67756c1fd48ab7ea9bd3a65be4.6%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36Chrome 91.0  Win1033f06118fb85aa17661a24d634bea9e34.3%Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15Safari Generic  macOSc40c0ac1b3cea8496393bd6215fd05ed3.6%Mozilla/5.0 (Windows NT 10.0; Win64; x64; … Continue reading

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