logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Java scripts working on Apache
Author
pedro2k



Joined: 17 Jun 2006
Posts: 16

PostPosted: Sun 29 Oct '06 9:33    Post subject: Java scripts working on Apache Reply with quote

Hi there!
I have put this code into a html document and tried to view it through apache and all i get it a blank screen!

I have the Jave development kit installed on the server, but i might have doen something wrong!!!
Or do i have to actiate something in apache?

So any suggestions would be very helpful!

<SCRIPT LANGUAGE="javascript">
var width = screen.width
var hieght = screen.height
document.write("<B>You're set to "+width+ "x" +height+"</B>")
</SCRIPT>
Back to top
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Sun 29 Oct '06 11:06    Post subject: Reply with quote

javascript is client side, nothing is needed at the server end.

PS: javascript NEQ java!

Luckly for you I know what is wrong Cool
Code:

<script type="text/javascript">
var sW = screen.width;
var sH = screen.height;
document.write("Your resolution is <B>" + sW + "x" + sH + "</B>");
</script>


Never use language="javascript" use type="text/javascript" instead.
the variables height and width aren't allowed. use something else (sW and sH)
Back to top
pedro2k



Joined: 17 Jun 2006
Posts: 16

PostPosted: Sun 29 Oct '06 12:34    Post subject: Reply with quote

Thank you so much!!!
I wasn't to sure on whether Java was server or client side!
Now thats sorted there is a chance i can get more working!!!

Just out of interest why do you use type="text/javascript"??
As you can possibly tell I am new to this stuff, i am just getting my head arond HTML and now i am working on PHP. MYSQL and JAVA and i am trying to learn as much as i can!!!

Thanks

Pedro
Back to top
Brian



Joined: 21 Oct 2005
Posts: 209
Location: Puyallup, WA USA

PostPosted: Mon 30 Oct '06 6:40    Post subject: Reply with quote

JavaScript wont work on my workstation by default. I use FF and have the NoScript plugin. So I must manually per site either permanently or temporarily authorize JS for each domain.

This is a pain but it is so much more secure!

So while I am in the minority, those sites the depend on JS for the little extra's, may suffer if the client does not accept the JS. Just a little note about JS. That is exactly why all my projects that require user form submition get both client side and server side validation Shocked
Back to top
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Mon 30 Oct '06 13:30    Post subject: Reply with quote

pedro2k wrote:
Thank you so much!!!
I wasn't to sure on whether Java was server or client side!
Now thats sorted there is a chance i can get more working!!!

Just out of interest why do you use type="text/javascript"??
As you can possibly tell I am new to this stuff, i am just getting my head arond HTML and now i am working on PHP. MYSQL and JAVA and i am trying to learn as much as i can!!!

Thanks

Pedro


Why i use type="text/javascript"?
Simple, there are money revisions of javascript, if you use the language attribute you can specifie the version aswel, some browser will ignor it so i use type="text/javascript" most browser support the latest version.
Back to top


Reply to topic   Topic: Java scripts working on Apache View previous topic :: View next topic
Post new topic   Forum Index -> Apache