wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Java and Java script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Java and Java script" Watch "Java and Java script" New topic
Author

Java and Java script

Stephen Black
Ranch Hand

Joined: Aug 13, 2009
Posts: 50

I have always assumed that if web browsers can run Java Script
They should be able to run compiled java
But as you know Assume makes an Ass out of You and Me
so I was wondering is compiled Java suitable for Web page (client side) development
or is Java Script the way?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61451
    
  67



[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61451
    
  67

In other words, Java and JavaScript have nothing whatsoever to do with each other. So, no, you can't use Java instead of JavaScript in the browser.

The closest you can come is Applets, and that ain't too close.
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
You could go the JSP/JSF/Servlet route, but that's more like doing the whole web site in Java.

John.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61451
    
  67

John de Michele wrote:You could go the JSP/JSF/Servlet route, but that's more like doing the whole web site in Java.

All of that Java still runs on the server. In order to control the client-side page, one needs to use JavaScript.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
Bear Bibeault wrote: . . . one needs to use JavaScript.
No longer a "beginning Java" question. Moving.
Stephen Black
Ranch Hand

Joined: Aug 13, 2009
Posts: 50

Anyone want to buy a book on learning Java? (Head First Java)
Can anyone recommend a book on Java Script?
I have learn't PHP and really want to learn something that will
be useful on the client side now
Im sure Java is useful but I could spend from now to eternity
learning programming languages and useful things
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
If you are/want to be a developer you are ALWAYS learning. If you do not, you will never stay employed.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61451
    
  67

The Flanagan book is still considered to be the "go to" book for JavaScript. But it can be overwhelming.

If you liked the Head First style of the Java book, there's also Head First JavaScript.

Many people rave about JavaScript: The Good Parts, but I'm not personally a big fan of it. It does cut to the chase, but I think it leaves too many important things out.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61451
    
  67

Stephen Black wrote:I have learn't PHP and really want to learn something that will be useful on the client side now

PHP, like JSP, is a server-side technology, not a client-side technology.
Trilochan Bharadwaj
Ranch Hand

Joined: Feb 02, 2009
Posts: 100
not necessarily related to OP, but thought, this might be of interest:
Rhino

I personally am following David Flanagan's incredible book : JavaScript : The definitive guide; I would suggest this book be read by everyone who wants to use JS regularly ... It demonstrates way too many things that makes our lives easier at work. I saw the presentation on YouTube on Good Parts, perhaps some day, I'll get it, for now, I am in love with Flanagan's book, always refer to it, when I need some help.


Personally speaking, because of the dynamic nature of JS and with some good practices, you can write quality stuff talking back to server.

On other technologies, I would have vouched for Flash + Adobe Flex, but the problem I have with Flash is that its owned by Adobe, Had it been open source and the VM would have been spec'd out the way Java VM is, It would have been readily available everywhere (well it is, but still not on mobile as far as I know); Plus the development cycle is much faster with open source IMHO.

Trilochan.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java and Java script