
Originally Posted by
ralph.m
What's your aim with this, anyhow? It doesn't sound very practical to target browsers in general.
I'm building a HTML5 mobile app. Unfortunately, there are only two browsers, namely chrome canary and opera labs, that support this sophisticated feature. A javascript app that work for chrome does not run on opera and vice versa and when I put them together none works. So I want to pull them separately base on the browser. Here's the catch:
Code:
<script>
if(browser = chrome) {
document.write("<script src='webkit.js'></script>")
} else if(browser = opera) {
document.write("<script src='opera.js'></script>")
}
</script>
Code:
JavaScript has no way to tell which browser is which apart from which features it supports.
This is not true. I've a javascript snippet on another computer that tell me which browser the a user use when they visit my website, including its version. It's just few line and very easy script. So I can't show you that script right now as googling cannot render anything that quite close to the script which I use.
Bookmarks