java script and hosting

S

Sender

I use java script and an applet to write a simple better-than-nothing
password checking for my site. I always think that java script is executed
in browser and has nothing to do with the server. But when I upload the same
pages to two different hostings, one works fine while the other always say
"error on page". The 2 sites are at below. You can easy see the code
unprotected.
http://home.netvigator.com/~zarino
http://tongs.freehosting.net

Never mine about the true password. keying anthing in the text box and click
"Go" then you will see the difference from the 2 sites. Any idea.
 
K

kaeli

I use java script and an applet to write a simple better-than-nothing
password checking for my site. I always think that java script is executed
in browser and has nothing to do with the server. But when I upload the same
pages to two different hostings, one works fine while the other always say
"error on page". The 2 sites are at below. You can easy see the code
unprotected.
http://home.netvigator.com/~zarino
http://tongs.freehosting.net

Never mine about the true password. keying anthing in the text box and click
"Go" then you will see the difference from the 2 sites. Any idea.


Java is not javascript.
And both javascript and applets are run on the client.

For the first address (~zarino) I get
The requested method POST is not allowed for the URL /
~zarino/index.html.

Which means the web server is configured incorrectly (or correctly,
depending on what the admin wanted) to disallow POST to html pages. Most
servers have POST to a normal HTML page disallowed. (your form uses the
POST method)

The second addy seems to work, so I assume the error you're talking
about is that first one.
It has nothing to do with java or javascript. It's the web server
config.


--
--
~kaeli~
All I ask is the chance to prove that money cannot make me
happy.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 
A

Andrew Thompson

Sender said:
I use java script and an applet to write a simple better-than-nothing
password checking for my site.

I did not see any applet, but since your initial
pages had no applet, it is pretty safe to say
this has nothing to do with Java, in fact, I
doubt is has much to do with JS either.
...I always think that java script is
executed in browser and has nothing to do with the server. But when I
upload the same pages to two different hostings, one works fine while
the other always say "error on page". The 2 sites are at below. You
can easy see the code unprotected.
http://home.netvigator.com/~zarino
http://tongs.freehosting.net

Never mine about the true password. keying anthing in the text box
and click "Go" then you will see the difference from the 2 sites. Any
idea.

You might try your luck over at
comp.infosystems.www.authoring.site-design,
but they will probably advise you to
validate your html as a first step.
http://validator.w3.org/
 
A

Anton Spaans

Sender said:
I use java script and an applet to write a simple better-than-nothing
password checking for my site. I always think that java script is executed
in browser and has nothing to do with the server. But when I upload the same
pages to two different hostings, one works fine while the other always say
"error on page". The 2 sites are at below. You can easy see the code
unprotected.
http://home.netvigator.com/~zarino
http://tongs.freehosting.net

Never mine about the true password. keying anthing in the text box and click
"Go" then you will see the difference from the 2 sites. Any idea.

You can not see your applet, because its height and width are both 1 pixel.
I get the error that the propery/method of the object document.app is not
supported. My guess is that the applet has not been loaded successfully. So,
document.app is undefined, and calling Encrypt_exe on this undefined value
generates the error.

I wonder, where is your Encrypt_txt.class stored. Where is its JAR? Be sure
that the location of Encrypt_txt.class is exactly the same on both pages
(relative path comparison).

-- Anton.
 
S

Sender

kaeli,
Thanks for the reply. The first one should work while the second one
doesn't. I don't have the POST problem, but I'll look into it. Since the
second one works for you, can you tell me what browser and version no. you
are using?
 
S

Sender

Anton,
Thanks for the reply. The applet is not supposed to be seen. It is just used
for encrypt (some sort of) the password. The same coding works in the first
URL but not in the second one. So the document.app should work. That is why
it is difficult to understand what went wrong. My class is not in JAR. It is
simply a class file in the same folder as the pages.

From your answer, am I right to say that both URLs do not work in your
browser? can you tell me what browser and version you are using? It seems
that this is related to the problem since both of them work when I access
them in my office (i.e. IE5). But only the first one works while at home
(IE6).
 
K

kaeli

kaeli,
Thanks for the reply. The first one should work while the second one
doesn't. I don't have the POST problem, but I'll look into it. Since the
second one works for you, can you tell me what browser and version no. you
are using?

Tested in NN7.1 and IE6 and Opera 7 on Win2K SP3 with the Sun Java
version 1.4.
In case it matters, the picture before and after the "login" are the
same. But I get no errors.

I have a feeling the problem may be people's java versions...

--
 
A

Anton Spaans

Hi Sender,

The first URL works fine (the one on your own homepage). The second one, on
the freehosting.net gives me the error.
The freehosting.net server may not provide the right mime-type for the
*.class files (Encrypt_txt.class in your case).
I got these headers from your Encrypt_txt.class download over the net:

From http://home.netvigator.com/~zarino/Encrypt_txt.class:
HTTP/1.1 200 OK
Date: Thu, 05 Feb 2004 15:26:03 GMT
Server: Apache/1.3.26 (Unix) mod_perl/1.27 mod_ssl/2.8.10 OpenSSL/0.9.6g
Last-Modified: Thu, 15 Jul 1999 10:00:23 GMT
ETag: "7c123-5aa-378db137"
Accept-Ranges: bytes
Content-Length: 1450
Connection: close
Content-Type: application/octet-stream

From http://tongs.freehosting.net/Encrypt_txt.class:
HTTP/1.0 200 OK
Connection: close
Date: Thu, 05 Feb 2004 12:20:06 GMT
Server: .V06 Apache/1.3.26 (Unix) mod_fs 6.005
Last-Modified: Wed, 04 Feb 2004 14:52:55 GMT
ETag: "f90c7e-5de-40210747"
Accept-Ranges: bytes
Content-Length: 1502
Content-Type: application/x-java

As you can see the mime-types are different, even the sizes (1450 &
application/octet-stream and 1502 & application/x-java)!
Some browser may not be able to handle the x-java mime-type....
This is probably because different servers are used with different
configurations.
Put your class file in a JAR and use the official method to load applets
(through JARs).

Google for "grab_url" or "graburl", to find a little free commandline tool
that shows you the HTTP headers of a request.
-- Anton Spaans.
 
S

Sender

Kaeli,
Thanks for the info. The problem resolved. It is due to my stupid mistake.
See my reply to Anton. Thanks again for your help.
 
S

Sender

Anton,

Thanks for the info. They explain everything. The length difference was due
to my stupid mistake when ftp the class. I forgot to use binary transfer.
Now problem resolved. Thanks again for your help.

By the way, I don't know how to use JAR to house the applet. Knowing that
JAR file is in fact zip. Can I simply zip the class file and rename it to
JAR and place it in the same folder as the html? Please lead the way.
 

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
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top