| Author | 
  | 
pedro2k
 
 
  Joined: 17 Jun 2006 Posts: 16
 
  | 
 Posted: Sun 29 Oct '06 9:33    Post subject: Java scripts working on Apache | 
     | 
 
  | 
 
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
  | 
 Posted: Sun 29 Oct '06 11:06    Post subject:  | 
     | 
 
  | 
 
javascript is client side, nothing is needed at the server end.
 
 
PS: javascript NEQ java!
 
 
Luckly for you I know what is wrong    
 
 	  | 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
 
  | 
 Posted: Sun 29 Oct '06 12:34    Post subject:  | 
     | 
 
  | 
 
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
  | 
 Posted: Mon 30 Oct '06 6:40    Post subject:  | 
     | 
 
  | 
 
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    | 
 
  | 
| Back to top | 
 | 
Jorge
 
 
  Joined: 12 Mar 2006 Posts: 376 Location: Belgium
  | 
 Posted: Mon 30 Oct '06 13:30    Post subject:  | 
     | 
 
  | 
 
 	  | 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 | 
 |