What is the difference between Java and JavaScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neogazz
    New Member
    • Apr 2010
    • 55

    #1

    What is the difference between Java and JavaScript

    What is the difference between Java and JavaScript? Also can you use plain Java programming within webpages or can JavaScript only be used?
  • Sinnergy
    New Member
    • Jun 2010
    • 3

    #2
    Originally posted by neogazz
    What is the difference between Java and JavaScript? Also can you use plain Java programming within webpages or can JavaScript only be used?
    Well as I learned. Java is object oriented programming, and Javascript is used to build more complex webpages (haven't tried using java script in webpages).

    You cannot use JAVA in webpages, but you can use JAVA Applets and embed it on web pages. You create JAVA Applets in java, and embed it in web pages.

    Comment

    • neogazz
      New Member
      • Apr 2010
      • 55

      #3
      Many thanks!

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        for JavaScript no plugin or JVM is needed ... any modern browser supports JavaScript out of the box ... even though there are differences in the implementation where IE mostly differs from all others since it uses its own ECMA script implementation JScript. The user might have disabled JavaScript in the browser ... so it could be that the code wouldn't run ... so in case you want to rely on it you would need a fallback. JavaScript allows you to create modern and desktop-like webpages today by using AJAX ... a technique that basically allows you to make asynchronous requests to the server and to update small or bigger parts of a webpage by using DOM methods. There are a lot of Libs/frameworks out there that provide widgets like grids, trees and provide animation/effects for them. It is much to prefer to use JavaScript instead of any other plugin-requiring techniques ... since a plugin requires an installation while JavaScript doesn't. The only real thing that cannot be done well with JavaScript today is to create images/charts ... while even this point will become less important when browsers will support canvas in the future with HTML 5.

        Comment

        • neogazz
          New Member
          • Apr 2010
          • 55

          #5
          So it seems like AJAX is better than JavaScript, as the browser might have JavaScript turned off?

          Can AJAX do everything that JavaScript does, also how do you start using AJAX in your webpage (i.e. do you add it in <script> tags contained in the html header of the page?

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            there is no difference - AJAX = Asyncronous JavaScript And XML ... so seen AJAX = JavaScript ... because you don't need to use XML and it doesn't need to be async ...

            Comment

            • neogazz
              New Member
              • Apr 2010
              • 55

              #7
              Thanks for the info? Last thing, do you still place AJAX into the <script> container within the <head> portion of your html code?

              Comment

              • SonaliAgarwal
                New Member
                • Jun 2010
                • 2

                #8
                Originally posted by neogazz
                What is the difference between Java and JavaScript? Also can you use plain Java programming within webpages or can JavaScript only be used?
                Java is a programming language in which we can create console applications, windows applications, web applications and mobile applications.

                And

                Javascript is a client-side scripting language used in web programming.
                In this many of the authentications are done on the client machine itself rather than going to the server for those processing.
                This helps the server from overburdening of requests made by client.

                Comment

                • neogazz
                  New Member
                  • Apr 2010
                  • 55

                  #9
                  Thanks for the explaination, however do you still place AJAX into the <script> container within the <head> portion of your html code?

                  Comment

                  • gits
                    Recognized Expert Moderator Expert
                    • May 2007
                    • 5390

                    #10
                    since it is JavaScript code it is to be included as JavaScript has to be included.

                    Comment

                    • neogazz
                      New Member
                      • Apr 2010
                      • 55

                      #11
                      Many many thanks! This is excellent info! Have a great weekend...

                      Comment

                      Working...