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: Thu, 21 Jan 2021 03:00:15 +0000 percentuseragentsystemuser_agent_string_md5 14.3%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36Chrome 87.0  Win102d6330f380f44ac20f3a02eed0958f669.0%Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0Firefox 84.0  Win102c129f86f872c5672a380bd7ea7a2cad8.4%Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36Chrome 87.0  Win1094fb6483abf307a4bafac80827dcc22a4.0%Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Safari/605.1.15Safari 14.0  macOS31be1cb15e7b312c97b6bcb4379c5cd43.0%Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0Firefox 84.0  Linuxf2b21363376cd03caa3f0369df2845ab3.0%Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36Chrome 87.0  macOSd8c889f6b9dfe2067a6d5fee37e97edb2.8%Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0Firefox 84.0  Linux8f124a1d88bbebc9925bd60b12b3e9722.3%Mozilla/5.0 (Macintosh; Intel Mac … Continue reading

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