Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Append element with the features of the browser - tested with Firefox, Chrome, IE-7/8/9
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery(document).ready(function($){
queryBrowser( "#idOfTextareaElement" );
function queryBrowser(element)
{
var target = $(element);
if( target.length > 0 )
{
var browserInfo = '';
browserInfo += "Real name: " + navigator.appName + "\r\n";
browserInfo += "Version: " + navigator.appVersion + "\r\n";
if(document.documentMode)
{
browserInfo += "Document mode: " + document.documentMode + "\r\n";
if( document.compatMode == "BackCompat" )
{
browserInfo += "Quirks mode: true \r\n";
}
if( document.compatMode == "CSS1Compat" )
{
browserInfo += "Quirks mode: false \r\n";
}
}
browserInfo += "Cookies enabled: " + navigator.cookieEnabled + "\r\n";
browserInfo += "Platform: " + navigator.platform + "\r\n";
browserInfo += "Headers: " + navigator.userAgent + "\r\n";
target.attr({ 'value': browserInfo });
}
}
});
//--><!]]>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.