WebKit
<SCRIPT LANGUAGE="JavaScript" SRC="webkit.js"></SCRIPT>
This line calls a separate file that includes the javascript used in this example.
You can use your own javascript to manipulate the input file any way you like.
<FORM NAME="MyForm">
<INPUT TYPE="TEXT" NAME="MyfileName" VALUE="test.txt">
<INPUT TYPE="BUTTON" VALUE="ReadFile"
OnClick='read(document.MyForm.MyfileName.value, "\\n", "MyFunction");'>
</FORM>
This section displays the simple form used to call the applet.
The text input is the name of the input file.
The button input calls the applet
<APPLET CODE="AcuteSoftWebKit.class" NAME="Ask" Width=0 Height=0>
<PARAM NAME="DC" VALUE="0">
<PARAM NAME="URLS" VALUE="">
</APPLET>
AcuteSoft Web Kit 1.0 is the first commercial Java applet in the World which
allows you to read a file from a server by simply calling a Javascript function. So
it's aimed to be easy (next version will even include wizards for non-programmers)!
It works on most browsers that allow communication between Java and Javascript
(that is to say above 3.X versions for Netscape and Internet Explorer).
There are three reasons why we have created such an innovative technology:
- One reason is many people can program in Javascript but are not java skilled
enough for crafting their own applets.
- Second reason is to allow every people hosted on free homepage services
with no cgi permission to have data-live site.
- Third and best reason is that Java technology alone can't do document
formatting with as much great flexibility as HTML language so by combining
Java with Javascript thanks to our technology it will become at last possible.
Traditionnaly when you want to read database file and show it on a page browser
you have to do one of two things:
- write a CGI program in C, Perl, ASP,... that runs on a server
- write a JAVA applet then compile and make it run on the client browser
The drawbacks of those traditional approaches are:
- For CGI you must have permission from your provider to run CGI program
because of security violation. The montly fee asked is then often much more
expensive for you.
- For CGI you must test your program remotely or you must install a server on
your own machine. If your platform is Windows you must retest or even
recompile your program if your host platform is Unix. So the process of
coding, testing, debugging can be rather long and of course you must
support high local communication fees in some countries (France,...).
- CGI and Java are simple for experienced C programmers but are still new to
others that do traditionnal programming and of course to novice programmers
that just know a few html and javascript which are more quick to learn.
- Java is not well suited for complex page presentation. Some components
exist to emulate basic HTML formatting capabilities but of course you just
have a few ones and the applet can be very long to load on client browsers.
The idea of combining Java with Javascript is obvious: Javascript cannot read file
on a server but a java applet can. So the applet will pass the text from the file to
Javascript so that Javascript can format it in HTML with the well-known
document.write function.
The problem is not conceptual but technical: if you try to
do so you will get a security violation from major browsers. So we solved the
problem for you and you don't have to worry about future support of our applet
from next versions of those browsers because the solution of the problem is purely
conceptual and we have used vital functions of Java and Javascript that won't
never be retrieved.
Of course we couldn't violate the most fundamental security features of java
applet: writing data on the server will be impossible (so you must still have CGI to
do that).
We assume that you know a little HTML and Javascript. If not so in next features
of our AcuteSoft Web Kit you will have assistant to do that job for you.
We have joined a HTML file template (click to see a functional demo) to
demonstrate how you could do that. It's very simple if you just know a little
Javascript (sorry for others but soon we will also target non-programmers people):
- Copy the HTML file template which contains our Javascript function Read
that will bind your function with the applet. You don't need to understand or
even read all our complex codes.
- Write your own Javascript function with one parameter for the text to be
received
<LI>Call Read(<filename>,<lineseparator>,<yourjavascriptfunction>)
<filename> is the ascii text file name that you want to read
<lineseparator> is usually "\\n" for new line.
<yourjavascriptfunction> is the name of your one parameter function that will
process the text formatting.
Back to the WebKit applet page.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|