Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

How to launch a JNLP in JavaScript page?

Thread view: 
NeoGeoSNK - 07 Nov 2006 08:16 GMT
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 :)
Andrew Thompson - 07 Nov 2006 10:34 GMT
> 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.
NeoGeoSNK - 08 Nov 2006 05:39 GMT
> > Hello,
> > The jnlp program can run in my IE  like this:
[quoted text clipped - 13 lines]
>
> 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^ ^"


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.