Re: HTML
"Andrew Thompson" <andrewthommo@gmail.com> wrote in message
news:a48b6193-681f-498e-aadd-3dbf6d640de3@y6g2000prf.googlegroups.com...
On Apr 7, 4:22 pm, "Richard Maher" <maher...@hotspamnotmail.com>
wrote:
<b...@coolgroups.com> wrote in message
news:cbd80cd4-2ab6-47d6-bef8-02676b56d90b@y9g2000yqg.googlegroups.com...
What is the easiest way to generate the HTML for putting an applet on
a web page?
This works for me: -
<script type="text/javascript">
var appletDef = navigator.appName;
if (appletDef == "Microsoft Internet Explorer")
Ask the JS programmers about the evils of browser
sniffing and the virtues of 'feature detection'.
Feature detection makes for more robust, maintainable
scripts.
Tell you what smart arse, why don't you "put up" your 'feature detection'
example for the OP to copy?
I got the example from a SUN page not dissimilar to his one: -
http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/using_tags.html
Maybe you should let SUN have a compy of your code as well?
No longer just a pragmatic case of "Use the form that works"? as in: -
"Andrew Thompson" <andrewthommo@gmail.com> wrote in message
news:1cd3c057-aa4c-4a7c-a94a-50f40d32fd09@r5g2000prh.googlegroups.com...
On Apr 6, 3:33 am, phil89 <pco...@free.fr> wrote:
..but this code is not running, do you have an idea ?
Sure. Use the form that works.
<Mostly to the OP />
Sun's latest deployJava.js (probably the first good
script to come out of Sun - excepting the one that
changes the JavaDoc page title to name the class) is
a good example of using feature detection, as far as
I recall the script and understand feature detection.
For more information on deployJava.js, see..
<http://java.sun.com/javase/6/docs/technotes/guides/jweb/
deployment_advice.html#deplToolkit>
Oh, you mean this bit: -
getBrowser: function() {
var browser = navigator.userAgent.toLowerCase();
or perhaps you were talking about this: -
if ((navigator.vendor) &&
(navigator.vendor.toLowerCase().indexOf('apple') != -1) &&
(browser.indexOf('safari') != -1)) {
if (deployJava.debug) {
alert('We claim to have detected "Safari".');
}
return 'Safari';
One thing I especially like about it is that they
actively encourage us to 'hot-link' to the script,
so our sites are always using the latest version of
the script (there were some quirky bugs to it at first,
but I think they have most of those sorted out by now.)
--
Andrew T.
pscode.org
Regards Richard Maher