How to launch a JNLP in JavaScript page?

N

NeoGeoSNK

Hello,
The jnlp program can run in my IE like this:
<a href="run.jnlp">run</a>
but when I place the jnlp file name in a javascript page It doesn't
work

l0 = new List("Management","",body,bg1,fg1,bg2,fg2);
l0.add(new Item("Management","run.jnlp",body));

it doesn't run the program but display the xml of run.jnlp in the IE,
is there somebody give some suggestion?
Thanks :)
 
A

Andrew Thompson

NeoGeoSNK said:
Hello,
The jnlp program can run in my IE like this:
<a href="run.jnlp">run</a>
but when I place the jnlp file name in a javascript page It doesn't
work ....
it doesn't run the program but display the xml of run.jnlp in the IE,

The IE? What does it do in a browser?
is there somebody give some suggestion?

Write your dynamic JNLP using JSP or servlets
(etc.), where your server side script can set the
content type properly.

Andrew T.
 
N

NeoGeoSNK

Andrew said:
The IE? What does it do in a browser?


Write your dynamic JNLP using JSP or servlets
(etc.), where your server side script can set the
content type properly.

Andrew T.



Thanks,
but the web page already write in a javascript like below, I don't know
how to replace the applet html part it with JSP:

<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops =
'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
win = window.open(mypage, myname, winprops);
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
// End -->
</script>

<SCRIPT language="JavaScript1.2"
src="/js/docjslib3.1/browserSniffer.js"></SCRIPT>
<SCRIPT language="JavaScript1.2"
src="/js/docjslib3.1/docjslibSuperClass.js"></SCRIPT>
<SCRIPT language="JavaScript1.2"
src="/js/docjslib3.1/docjslibNS4SubClass.js"></SCRIPT>
<SCRIPT language="JavaScript1.2"
src="/js/docjslib3.1/docjslibNS6SubClass.js"></SCRIPT>
<SCRIPT language="JavaScript1.2"
src="/js/docjslib3.1/createTheProperSubClass.js"></SCRIPT>
<SCRIPT language="JavaScript1.2">
<!--
var classSelectionObj = new createTheProperSubClass();
var myBrowserAPIObj = classSelectionObj.getTheProperSubClass();
// -->
</SCRIPT>
<SCRIPT language="JavaScript1.2" src="/js/pj_box/pj_box.js"></SCRIPT>

<style>
TD
{
font-family: "Arial","MS Sans Serif";
font-weight: bold;
font-size: 12px;
color: white;
text-decoration: none;
}

A.clist
{
font-family: "Arial","MS Sans Serif";
font-weight: bold;
font-size: 12px;
text-decoration: none;
}
A.citem
{
font-family: "Futura Bk BT","Arial","MS Sans Serif";
font-weight: normal;
font-size: 12px;
text-decoration: none;
}
</style>
</head>
<body bgcolor="#dedede">
<SCRIPT language="JavaScript1.2">
<!--
var bg0 = "#ddaa44";
var bg00= "#eebb55";
var bg1 = "#ffcc66";
var bg2 = "#e8f0f0";

var fg1 = "#000000";
var fg2 = "#000000";

var body = "MAIN_FRAME";
var top = "_top";
var neww = "_blank";


l0 = new List("HLR Management","",body,bg1,fg1,bg2,fg2);
l0.add(new Item("HLR Management","hlr.html",body));



init_box(
2,
2,
160,
24,
16,
1,
true,
2,
2,

0,
0,

2,
2
);
// -->
</SCRIPT>
</body>
</html>

=================================================
The "l0.add(new Item("HLR Management","hlr.html",body));" was a menu
item on the web page, and hlr.html is a java applet html, I want to
replace it with a JNLP file, so i modify it to
"l0.add(new Item("HLR Management","run.jnlp",body));" but it doesn't
work^ ^"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top