473,729 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

java plugin targeting through javascript

Adding an applet to a web page through the <object> tag, allows you to
target the JVM in 2 ways.

(ref. http://java.sun.com/products/plugin/versions.html )

1. "Dynamic Versioning", which basically means "run with version X or
greater".
2. "Static Versioning", which targets a very specific version, e.g.
1.3.1_06.

Sadly, the reality for developers is neither. Usually an application
is developed/tested for a specific range of versions, e.g. 1.3.1_02 ->
1.3.1_07.

I thought I might be able to use some JavaScript trick to iterate
through a few "Static Versioned" values, and stop when a successful
applet initialization took place.

I don't really do much JavaScripting so I have been unsuccessful. Any
help is appreceated. Here is an example first attempt (minus
irrelevent stuff) so you know I'm not completely lazy:
<html>
<head>
<title>Plugin Target Test</title>
<script type="text/javascript">

function tryV(version)
{
document.write( 'trying ' + version + '<br>');

for (i=0; i<version; i++) //has an earlier version worked?
{

if(document.get ElementById("ve rsion" + i)!=null) // NOTE: this
doesn't really do what I want, but the idea is there
return;
}


//classid value targets Java 1.3.1_0[version]
document.write( '<OBJECT id="version' + version + '" classid =
"clsid:CAFE EFAC-0013-0001-000' + version + '-ABCDEFFEDCBA" ');
//document.write( ' codebase =
"http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Versio n=1,4,2,0"
');
document.write( ' WIDTH = 100% HEIGHT = 100% NAME = "Applet"
ALIGN = center > ');
document.write( ' <PARAM NAME = CODE VALUE = "com.foo.Ba r" > ');
document.write( ' <PARAM NAME = ARCHIVE VALUE = " ');
document.write( ' jar1.jar, jar2.jar" ');
document.write( ' <PARAM NAME = NAME VALUE = "Applet" > ');
document.write( ' <PARAM NAME = "type" VALUE =
"applicatio n/x-java-applet;jpi-version=1.3"> ');
document.write( ' <PARAM NAME = "scriptable " VALUE = "false"> ');
document.write( ' <PARAM NAME = "PROPERTIES "
VALUE="applet.p roperties"> ');
document.write( version + 'no good<br> ');
document.write( ' </OBJECT>');

}

</script>
</head>
<body>

<!--"CONVERTED_APPL ET"-->
<!-- HTML CONVERTER -->
<script type="text/javascript">

//try some acceptable values
tryV(3);
tryV(4);
tryV(5);
tryV(6);

</script>
</body>
</html>
Jul 20 '05 #1
1 2190

"mark" <z5*@hotmail.co m> wrote in message
news:fe******** *************** ***@posting.goo gle.com...
| Adding an applet to a web page through the <object> tag, allows you to
| target the JVM in 2 ways.
|
| (ref. http://java.sun.com/products/plugin/versions.html )
|
| 1. "Dynamic Versioning", which basically means "run with version X or
| greater".
| 2. "Static Versioning", which targets a very specific version, e.g.
| 1.3.1_06.
|
| Sadly, the reality for developers is neither. Usually an application
| is developed/tested for a specific range of versions, e.g. 1.3.1_02 ->
| 1.3.1_07.

I thought you could get the JVM version from the various browser's object
models. I know you can use VBScript in IE to create Java objects of a
specific version and have seen scripts that iterate until they hit one that
returns an object. Not sure how to do it in JS though.

|
| I thought I might be able to use some JavaScript trick to iterate
| through a few "Static Versioned" values, and stop when a successful
| applet initialization took place.
|
| I don't really do much JavaScripting so I have been unsuccessful. Any
| help is appreceated. Here is an example first attempt (minus
| irrelevent stuff) so you know I'm not completely lazy:
|
|
| <html>
| <head>
| <title>Plugin Target Test</title>
| <script type="text/javascript">
|
|
|
| function tryV(version)
| {
| document.write( 'trying ' + version + '<br>');
|
| for (i=0; i<version; i++) //has an earlier version worked?
| {
|
| if(document.get ElementById("ve rsion" + i)!=null) // NOTE: this
| doesn't really do what I want, but the idea is there
| return;
| }
|
|
|
|
| //classid value targets Java 1.3.1_0[version]
| document.write( '<OBJECT id="version' + version + '" classid =
| "clsid:CAFE EFAC-0013-0001-000' + version + '-ABCDEFFEDCBA" ');
| //document.write( ' codebase =
|
"http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#
Version=1,4,2,0 "
| ');
| document.write( ' WIDTH = 100% HEIGHT = 100% NAME = "Applet"
| ALIGN = center > ');
| document.write( ' <PARAM NAME = CODE VALUE = "com.foo.Ba r" > ');
| document.write( ' <PARAM NAME = ARCHIVE VALUE = " ');
| document.write( ' jar1.jar, jar2.jar" ');
| document.write( ' <PARAM NAME = NAME VALUE = "Applet" > ');
| document.write( ' <PARAM NAME = "type" VALUE =
| "applicatio n/x-java-applet;jpi-version=1.3"> ');
| document.write( ' <PARAM NAME = "scriptable " VALUE = "false"> ');
| document.write( ' <PARAM NAME = "PROPERTIES "
| VALUE="applet.p roperties"> ');
| document.write( version + 'no good<br> ');
| document.write( ' </OBJECT>');
|
| }
|
| </script>
| </head>
| <body>
|
| <!--"CONVERTED_APPL ET"-->
| <!-- HTML CONVERTER -->
| <script type="text/javascript">
|
| //try some acceptable values
| tryV(3);
| tryV(4);
| tryV(5);
| tryV(6);
|
| </script>
| </body>
| </html>
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3346
by: ewright66 | last post by:
I'm trying to access CiscoWorks 2000 from a home PC via VPN on a Win XP Home Edition computer. CiscoWorks requires Java JRE 1.3.1 to apparently open applets. When I try to bring up a Topology Map of our network or open CiscoView I get the following errors. java.io.FileNotFoundException: http://XXX.XXX.XXX.XXX:1741/CSCOcm/classpath/cmtop-sign-1-3.jar
2
6926
by: Eyal | last post by:
Hey, I would appriciate if anyone can help on this one: I have a java object/inteface having a method with a boolean parameter. As I'm trying to call this method from a javascript it fails on a type mismatch. It is positively because of the boolean(java primitive)parameter. It goes fine if I change this parameter to int or String. This inteface has a lot more methods which works fine, it is just the
1
2324
by: Jan Vinten | last post by:
Hello, I'm looking for a javascript, that can detect which java VM is installed and what the current version is. Can any of you give me some details? Best regards, Jan Denmark
1
1623
by: valere | last post by:
I look for information for communicating between JavaScript and a native plugin. I noticed that LiveConnect is oriented to communicate as a "bridge" between Java and JS. But how to process with a native plugin ? Thanks in advance for answering to the newbye I am.
4
1977
by: Dani Shapira | last post by:
Hi. can anyone help me with how to find if JAVA is evalible and if yes, of what version? Thanks Dani
2
13519
by: Tim Murray | last post by:
First of all, I don't know much about Java, even its naming and version numbering nomenclature, and second, if there is a better group to ask this in, please let me know. System is Mac with 10.4.4. I have Java 1.3.1 and 1.4.2 plug-ins, and J2SE 5.0 (1.5.0) installed. The Java preferences application lets me choose J2SE 5 or 1.4.2 to run applets via a browser. The problem happens in both settings. The problem is that we have a...
1
9646
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
4
11481
by: aotemp | last post by:
Does anyone know how to detect the version of Java installed? My website has an application that requires java 1.5+ to be installed, basically if the user doesn;t already have it installed I redirect them to the java download page... thanks!
2
4552
by: cloudy | last post by:
First at all, i'm sorry, i not good in writing english. i want to retrieve a string from my applet via Javascript. I use a method named ReadAll. public String ReadAll(String StrOut, String Keywords, String condition) { ::: ::: return description; }
0
8921
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9284
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9202
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9148
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8151
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4796
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.