0
Can i write java in a the body/head of a html file instead of javascript? Or are they the same thing?,
5 Answers
+ 2
the quote I like that sums it up is: "Java is to JavaScript like Car is to Carpet"
Although JavaScript can be run on the server too (Node.js), it's always been more commonly used to make websites interactive. That means that web browsers are able to run JavaScript themselves. You can code up a site with html, css and JavaScript, open up the html file inside a browser and everything will run. No server needed and you don't even have to be connected to the internet (unless you're linking to jQuery or something)
Java on the other hand can only be run on a server. A web browser would have no idea what to do with it. so for web applications, the server runs all the Java code and creates the html,css,JavaScript files that it hands off to the browser.
+ 3
Java and javascript are different. You can use javascript inside the script tag.
0
where do i write java? @james
0
sry, im new of this but can i "connect java" to a website or is it just for a program? @james
0
So java and js is the same thing (how you code it)
@james