Communication Between Java Applet And Javascript

Jul 20, 2005

let's me explains my long problem:

I'm doing an intranet with a media part. So im must be able to upload files on
a ftp server AND have a record of informations about this file and meta date in
a MySQL database, shown in a php page.

So the first thing i was doing was:

1/ * A HTML Form, with a <input type="file"> which was uploading the file to
the web server. And then, in the next action-php-page, using ftp functions from
php to upload to the ftp server. But this make upload the file 2 times, which
slow, and the user can't do anythig except waiting in front of a blanck loading
page.

=> no way

(BTW, the site admin refuse that the ftp server and the web server to be the
same computer)

So i tried something else:

2/ * A HTML form, the user enter meta data about the media, click next, and
then, a php page which loads a java applet an pass informations to it (by param
tags).
The applet have a browse button, and a go button, which start the transfert
(JDK 1.4.1) trough the URLConnection. The file is uploaded once, and there is a
progress bar, which is wonderful.

But now, i need the src_file information wich is the java applet. So i have two
options:

A/ I make a post to the webserver from the applet. But i'm using session
identification (needed for tracing users actions) and i'm gonna use SSL in less
than one month, so i think it would be complicated.

B/ I export the information from the java applet to javascript, and then to
HTML hidden field, so that the user can submit the full-hidden-filled form. But
i can't make LiveConnect works.

i'm under Mac OS X 10.2 (jaguar) so i need to make work LiveConnect on both
Safari 1.0 (v85.6), mozilla 1.5, and Mac OS IE (5.2).

View 2 Replies


ADVERTISEMENT

Java Applet Verses JavaScript For Scrolling Text

Jun 24, 2002

I am looking at a client’s site that has a scrolling text bar at the bottom of the page for latest news. I have been asked to recommend whether they keep the scrolling text as a java applet or whether they make it dhtml with Javascript to make it scroll.

To be honest, I’m not sure whether there really is an important difference, in terms of download time, likelihood of working (if client browsers are better enabled for one verses the other), or whether there are any other reasons one should be used over the other.

View 2 Replies View Related

Applet - Javascipt Communication.

Jul 20, 2005

How can I inform a Javascipt, that must submit my Applet's data, that this same Applet has produced the data in question? Or in other words, is there any way to call a JavaScript junction within the Applet? Is it the best way? What do you suggest?

View 1 Replies View Related

How To Use Prompt On A Java Applet.=

Jun 22, 2010

Does anyone know how to use a prompt on java applet?

I was to create a very simple calculator. Two prompts will appear asking for inputs. Then the sum, product, difference, and quotient will appear on java applet.

View 2 Replies View Related

Updating Url Param - Java Applet

Feb 3, 2004

I'm trying to load different java applets with a click of a button ... but with no success. Here's my code:

View 1 Replies View Related

Applet Event Handlers Changed With Java 1.4.x?

Jul 23, 2005

I recently "inherited" a project which involves an applet on a web
page, and some Javascript event handling functions. The handler definition looks
like this:

<SCRIPT LANGUAGE=javascript FOR=Foo EVENT=mouseReleased>
<!--
Foo_mouseReleased();
//-->
</SCRIPT>

where Foo is an applet with parameter FiresScriptEvents set to TRUE.
The function Foo_mouseReleased() is a simple javascript function that just
alerts a fixed message so I know it's been called.

When I run this applet in a vanilla IE5.5 or IE6, it does exactly what
I expect - when the mouse is released, up pops my alert. BUT when I
run it on the same browser with Java Plug-In 1.4.2 installed, I don't
see it. Is there some compatibility issue with 1.4.x? Can the code be
changed relatively simply to work with both VMs, or am I looking at a
big rebuild to support browsers both with and without the plug-in?

View 2 Replies View Related

Java Applet Development - Code To Check Whether JRE Is Installed On Client Machine?

Aug 19, 2009

Java Applet Development - JavaScript code to check whether JRE is installed on client machine.

View 4 Replies View Related

PHP & JavaScript Communication

Feb 24, 2006

Let's say I want Javascript to call PhpScript.php?Somevar=Somevalue and display the info. How do I get the php returned data in a Javascript var.

View 4 Replies View Related

Cross Frame Javascript Communication

Oct 28, 2003

I have set of frames... one contains a menu and the other a status frame. I am calling a function from the menu which sets the variables however I need some help passing those variables to the status frame. How would I go about doing such a thing?

This is called from the menu in frame 1 but doesn't work:

Code:
function jumpsec(cat, prod) {
parent.statusbar.category=cat;
parent.statusbar.product=prod;
}

// then my status frame bar has:
document.write(parent.statusbar.category);
document.write(parent.statusbar.product);

The 2 variables are blank on statusbar onload but get populated with each click.

View 4 Replies View Related

Javascript -> Applet

Jul 20, 2005

I have on a html page an applet. A javascript function call one function of
this applet. It works with IE but not with Mozilla or Netscape. I obtain
the following error on the java-plugin consol:

sun.plugin.liveconnect.OriginNotAllowedException: Javascript is not form the
same origin as je java code ...

This is my html code:

<script language="Javascript">
<!--
function askServerCmd()
{
return document.AppReaderLink.askServerCmd();

}
//-->
</script>
<applet CODE =" AppReaderLink.class"
codebase="."
ARCHIVE ="appredl.jar"
WIDTH =" 130"
HEIGHT =" 70"
NAME =" AppReaderLink"[color=blue]
>[/color]
</applet>

I tri with jre 1.4.1_05 and jre 1.4.2_02 and I obtain the same thing.

What I have to do?

View 1 Replies View Related

Display A Message That Applet Is Loading! While Applet Loads

Apr 8, 2006

How do I display a message applet is loading when a applet is getting
loaded. Without using Mediatracker.I want the message to be provided as
PARAM NAME.

View 1 Replies View Related

Calling Javascript Functions From Applet

Jul 23, 2005

We have an applet that has to support the SUN VMs as well as the MS VM.
The applet receives updates from a server (via tcp or http) and wraps them
up as objects and passes them using the JSObject scripting context to a
javascript function.

This function takes the object and reads the properties and updates a
screen.

All seems simple stuff. The problem is that the MS JVM runs like a rocket,
but the sun vm seems to max out our processor and also takes ages to process
anything.

I have tried logging from the console using debug level 5, and it shows a
lot of back and forth between the applet and the javascript when accessing
methods on the object passed.

Seeing that as a possible problem, I now pass a delimited string to the
front end, and then convert that into an update message purely in javascript
so there is only one hit to the applet per message.

I am still seeing a massive difference between the sun and ms VMs.

Has anyone ever come across this, and is there anything I can do to help
flatten out this performance?

View 1 Replies View Related

Testing Javascript Call To Applet?

Mar 22, 2005

Does anyone know how you can test if an applet's method exists before you try and call it?

for example, if you don't have a JRE installed on your computer and try and access an applet method it shoots out a javascript error at you. I want to be able to test if the applet is operational basically before I try and use any of its methods.

View 2 Replies View Related

Determine If Applet Is Loaded With Javascript

May 31, 2005

I call methods in a Java applet with javascript code like this:

document.myApplet.methodName();
This works great when the applet has loaded (the JVM has started and dowloaded all the jars) but it fails if the applet hasn't loaded yet, at which point it gives an error:
Quote:

Error: Object doesn't support this property or method

Is there a way to determine that the applet is loaded or not so that I can use it in an if statement? For instance, like so:
Code:
if (isAppletLoaded()) {
document.myApplet.methodName();
}
I tried
Code:
document.myApplet == null
but that didn't work.

View 3 Replies View Related

Error When Calling Javascript From Applet After Upgrading JRE

Oct 6, 2005

I've been invoking a javasript method from an applet using the
netscape.javascript.JSObject class.

All was working fine till I upgraded my JRE from 1.4.0 to 1.5

Now the method JSobject.getWindow(this) is returning an exception:

netscape.javascript.JSException

View 1 Replies View Related

Error While Calling Applet Methods From Javascript

Aug 9, 2005

The javascript fails to call an embeded applet's function. In the javascript
console, it shows "Error XXXX is not a function". Following are some parts of my code.

if(parent.document.cpmApplet){
parent.document.getElementById('cpmApplet').refreshCPMApplet();
}
if(parent.BottomIframe.document.resultApplet){
parent.BottomIframe.document.getElementById('resultApplet').refreshTableApplet ();
}

Here parent.document.cpmApplet and parent.BottomIframe.document.resultApplet are valid since I loaded both the applets with the same name using <APPLET> tag for Netscape/Mozilla and OBJECT tag for Windows.

The issue is with Netscape and Mozilla on Unix platforms only. I would appreciate if anyone could help me to solve this.

View 4 Replies View Related

Javascript Using Java Methods

Jul 23, 2005

Can Java classes/objects be used from within the javascript code on the
HTML page? I.e., can I call a Java method from the javascript function?

View 2 Replies View Related

How To Pass Value From Javascript To Java In Jsp

Jul 23, 2005

in JSP, it's easy to pass value from java-variable to
javascript-variable, like

js_function(a)
{ a=<%java-class.A%>
}

I'm wondering how is the other way around? I tried

js_function(a)
{ <%java-class.A=%>a
}

but there was compiling error.

View 3 Replies View Related

DHTML, JAVA, JAVASCRIPT?

Apr 19, 2001

Is DHTML a language? or is it a composition of JavaScript and css? Does Java(not javascript) has something to do in it?

What is actually the best to create client-side dynamic pages?
I know JAVA is used to create applets but I am not sure of wich is the most powerful....

Also, wich are the newer versions of all the above languages?

View 15 Replies View Related

Java Vs Javascript For AJAX?

Jan 19, 2007

I am a XHTML/CSS developer with an interest in AJAX. I am at the stage were I wish to learn how it's all done.

So my quesiton is this:

To develop AJAX applications do I need to learn JAVA or Javascript?

It may sound like a dumb question considering AJAX is mainly javascript and XML, however will learning JAVA first off be a benefit?

View 4 Replies View Related

Call A Java Method From Javascript

Jun 5, 2006

I am trying to call a java method from within my Javascript, but cannot
seem to get it to work. All the examples I have found online and in
the forums are using Java applets. I have a method that I want to call
that does a search, and produces a message dialog displaying the
results. Also, the class file lives next to the html file. How would
I invoke this in my code? This is what I have now:

<script>
function searchStrings(){
Searcher.search();
}
</script>
<form>
<input type="button" value="Search" onclick=searchStrings()>
</form>

View 2 Replies View Related

Passing Arrays To Java From JavaScript

Jul 20, 2006

This may be more of a Java question, but I feel that JavaScript experts
may be more qualified to help me find a solution.

In short: is it possible to call a Java method from JavaScript, passing
as an argument a JavaScript array (in my case, an array of doubles)?

Supposing I have array x containing only doubles, I have tried:
document.MyApplet.myMethod(x);

But the method only ever seems to receive "null" as an argument.
Conversely, if I try this with a String, or a single character, or
almost anything else, there isn't a problem. Any ideas?

View 1 Replies View Related

Calling A Java Class From Within Javascript

Aug 23, 2006

Can you call a java class from within a javascript?

View 1 Replies View Related

Does Javascript Have A Stop() Method Like Java Applets?

Jul 23, 2005

A Java applet has two methods stop() and destroy() that get called when the user moves to a different page. Does javascript have anything similar?

View 2 Replies View Related

How To Execute An External Java Application By Javascript?

Jul 23, 2005

I am writing a java application as a mozilla extension.
Because mozilla uses javascript for the frontend,
i need the javascript to call my external java application
and pass one parameter to it.

View 1 Replies View Related

How To Set Default Homepage In Mozilla Using Java/JavaScript

Aug 23, 2006

Can anyone help me how to set default website as homepage in mozilla using java/ javascript.

Following javascripts code works in IE but not in Mozilla.

<input type="button" value="Set Default" onClick="this.style.behavior='url(#default#homepage)'
this.setHomePage('http://www.myDefaultWebsite.com')">

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved