#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    56
    Rep Power
    13

    Question java or javascript?


    some guy told me that Java and Javascript are very different, he said that one makes scripts for web pages and the other is for executable files non related to websites just like .vbs files.

    which one is the website related one? i don't want to blow 80 bucks (Canadian) on a huge O'Reilly book to find out i bought the wrong one.
    PHP is fun
  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    You're probably looking for javascript. That's the one that lets you interact with the html in a webpage.
    Java is bigger, badder, bolder, and much more ambitious. It can also br web-related, though it doesn't have to be. Java applets (programs that run inside your html pages), and servlets (programs that run on a webserver that can connect html to databases) and applications (like the web browser you're reading this with) can all be written in Java.
    Other than the similarity in name, they aren't related. Both have a similar syntax (grammar rules), that decend from C (another programming language), and it is possible for them to interact with eachother, but they were created by different companies for different purposes.
    They're both worth learning if you have the time, though.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    56
    Rep Power
    13
    sorry if i sound like a stupid moron here but i ask this about everything.......what can Javascript do that PHP can't do? i know they are very different but since i started reading lots into this PHP book of mine about what it can do, i can't think of anything it can't do.

    thanks for the imput there
    btw isn't ambiguous a bad thing? my oxford dictionary says ambiguous means "open to more than 1 interpretation" which sounds not good when it comes to programming. keep in mind that i suck at programming though
    PHP is fun
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Posts
    286
    Rep Power
    13
    Javascript is run on the client site (ie in the web browser) and PHP is run on the server site. They are used for different things and if you are looking at making web application both are useful.
  8. #5
  9. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    btw isn't ambiguous a bad thing?
    What does ambiguous have to do with it?
    bricker42 said ambitious which is in no way similar to ambiguous.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    56
    Rep Power
    13
    sorry, i suck at reading. rather than reading words i just sort of skim over them.
    PHP is fun
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    somethings i need to add:

    there is also server-side JavaScript. but it is seldomly used and afaik only supported by Netscapeīs server products. AND:

    from your first post:
    for executable files non related to websites just like .vbs files
    this is wrong. vbs is available as server-side ("ASP"), client-side ("VBScript") and standalone ("WSH").
    and: java can be used just the same. Server-Side ("JSP", "Servlets"), client-side ("JavaScript", most people donīt consider this being java), standalone ("Java Applications" - the most powerful use for it)

    the difference is that java (NOT javascript) is COMPILED and runs on any OS having a JVM while vbs is ALWAYS a scripting language only available on MS Win****!.
  14. #8
  15. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    You can use javascript (jscript) to write asp files, actually.
    Also, java on the client-side would be applets, I think, and javascript is most definately NOT java. Just to nitpick
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    aaaargh. yes, applets. youīre right.

    to make it clear in one sentence: javascript has nothing in common with java besides the basic syntax.

    ... didnīt know about the ASP-JScript yet...
  18. #10
  19. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Yes, well, if the idea of writing code that only runs on a Microsoft server appeals to you, why wouldn't you use vb, right?
    And I remember hearing that the name javascript was a kind of marketing ploy to gain marketshare from the popularity of java.
  20. #11
  21. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16

IMN logo majestic logo threadwatch logo seochat tools logo