Skip to content

Instantly share code, notes, and snippets.

@Albirew Albirew/arch.js
Created Jan 12, 2016

Embed
What would you like to do?
Un vieux JS pour executer une action selon l'architecture de l'utilisateur (un exemple d'usage sur: http://albirew.fr/nddyn/ )
/*JavaScript action based on Arch*/
if (navigator.userAgent.indexOf('MSIE') != -1 ){document.write('<span style="color:red; font-weight: bold;">Internet ExplHORREUR!</span>');}
else if (navigator.userAgent.indexOf('Trident') != -1 ){document.write('<span style="color:red; font-weight: bold;">Internet ExplHORREUR!</span>');}
else if (navigator.userAgent.indexOf('Win64') != -1 ){document.write('<span style="color:green; font-weight: bold;">x64 browser on x64 Windows</span>');}
else if (navigator.userAgent.indexOf('WOW64') != -1 ){document.write('<span style="color:red; font-weight: bold;">x86 browser on x64 Windows</span>');}
else if (navigator.userAgent.indexOf('i686 on x86_64') != -1 ){document.write('<span style="color:red; font-weight: bold;">x86 browser on x64 Linux</span>');}
else if (navigator.userAgent.indexOf('x86_64') != -1 ){document.write('<span style="color:green; font-weight: bold;">x64 browser on x64 Linux</span>');}
else {document.write('... . . . something!');}</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.