I have a small script that determines if a user is using a specific browser
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if(is_chrome){
$('.ifChrome').attr('style', 'display:block;');
$('.ifChrome').html($('noscript > div').html());
};
If they use this browser, we want to display the div tag and show the HTML from another div tag inside.
<noscript>
<div class="note">
Your browser does not properly support the WMD Markdown Editor.<br />
Please use <a href="/about/markdown" target="_blank">Markdown<.a> to style your input.
</div>
</noscript>
<div class="hidden ifChrome note"></div>
What I'm trying to do is show the โunsupportedโ text inside the tag <noscript>for users who use this browser (since WMD Markdown does not work properly).
My existing Javascript is not working. Any help would be greatly appreciated.
source
share