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
ADVERTISEMENT
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
View Related
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
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
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
Aug 19, 2009
Java Applet Development - JavaScript code to check whether JRE is installed on client machine.
View 4 Replies
View Related
Feb 28, 2006
I came across this javascript scrolling text. My problem is :- I need to have a huge big long message/ messages, but after a certain point the scroller stops scrolling and goes back to the beginning so doesnt show every message that I want. I have tried to take out the <nobr> tags but that doesnt work. Is there anyone out there that can have a look at the code below and see if it can be modified to allow multiple lines of messages. Many thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript1.2">
<!-- Begin
var l1 = 0; // left of ticker in pixel, or 0 to position relative
var t1 = 0; // top of ticker in pixel, or 0 to position relative
var w1 = 780; // width of ticker in pixel
var ie = document.all ? true : false;
var first = true;
var l2 = l1 + w1;
var l3 = l1 - l2;
var l = l2;
function tickinit() {
if (ie) {
if (l1 == 0 && t1 == 0) {
pos = document.all['tickpos'];
l1 = getLeft(pos);
t1 = getTop(pos);
}
ticktext.style.posTop = t1;
}
else {
if (l1 == 0 && t1 == 0) {
pos = document.anchors['tickpos'];
l1 = pos.x;
t1 = pos.y;
}
document.ticktext.pageY = t1;
}
l2 = l1 + w1;
l3 = l1 - l2;
l = l2;
setInterval('tick()', 10);
}
function getLeft(ll) {
if (ll.offsetParent)
return (ll.offsetLeft + getLeft(ll.offsetParent));
else
return (ll.offsetLeft);
}
function getTop(ll) {
if (ll.offsetParent)
return (ll.offsetTop + getTop(ll.offsetParent));
else
return (ll.offsetTop);
}
function tick() {
l = l - 1;
if (l < l3) l = l2;
cl = l1 - l;
cr = l2 - l;
if (ie) {
ticktext.style.posLeft = l;
ticktext.style.posTop = t1;
ticktext.style.clip = "rect(auto "+cr+"px auto "+cl+"px)";
if (first) ticktext.style.visibility = "visible";
}
else {
document.ticktext.pageX = l;
document.ticktext.clip.left = cl;
document.ticktext.clip.right = cr;
if (first) document.ticktext.visibility = "show";
}
first = false;
}
// End -->
</script>
</head>
<body OnLoad="tickinit()"> .....
View 6 Replies
View Related
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
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
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
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
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
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
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
Aug 6, 2010
im searching for a plugin/code example for text scrolling. I got some text in a <div> if text is longer than for example 300px it gets cut and is scrolling from start to end, stops for a second and then scrolls back, stops and all over, and if its not long enough than 300px then just displays normaly. Something similar to the Song name scrolling inin anyMP3 player.
View 2 Replies
View Related
May 17, 2007
I find myself having to dynamically create HTML code, and have found
that the usual way you see to do this is an unreadable mess, like this:
blah('<span id="' + id + '"><a href="' + link + '">' + linkText +
'</a></span>');
So instead, I would like to do something more like the variable
interpolation in Perl and other languages:
blah(XXX('<span id="@id"><a href="@link">@linkText</a></span>'));
The XXX function here would interpolate the values of any variables
named with a @ prefix into the string. Why @? Why not?
So using my favorite JavaScript console (FireBug), I typed the following
and ran it:
x = "hello world";
y = 42;
z = "--@x/@y--"
z = z.replace(/@(w+)/g, function (dummy, v) {
return eval(v);
});
alert(z);
And it works. The alert box shows "--hello world/42--" as expected.
Okay, so now let's turn it into a function:
x = "hello world";
y = 42;
function XXX(s) {
return s.replace(/@(w+)/g, function (dummy, v) {
return eval(v);
});
}
alert(XXX("!!!@x~~~@y!!!"));
And again, it works. The alert box shows "!!!hello world~~~42!!!" as
expected. I should be able now to just drop this *same* code into a
<scriptsection of a web page, right?
Wrong. If I take the *same* code as my second example and plop it in a
web page, the alert does not show the same thing as when in FireBug's
console. It shows the same string passed to XXX, unchanged.
Other experimentation tells me that when placed in a web page, the
anonymous function to do the eval call is never invoked, which suggests
that the regular expression didn't match.
I've only tried this in FireFox 2 and IE 7, but if it doesn't work
properly in either of those, I really don't care about the other browsers.
My guess is there is a difference in the execution environment of
FireBug's console (or likely, any JavaScript console) and the execution
environment of a web page. The questions are what is that difference,
and how do I make my XXX function work properly?
View 3 Replies
View Related
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
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
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
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
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
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
Aug 23, 2006
Can you call a java class from within a javascript?
View 1 Replies
View Related
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
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
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