ANSWERS: 5
  • Javascript is a "Programming Language of the Net" used to add interactivity to a web page. There are games, forms, calendars... and unfortunatly virus installers(but dont get scared) coded in simple javascript. Not to be confused with Sun JAVA. "JSP" is the extension of a JavaScript page: eg. http://www.example.site.com/index.JSP A javascript page uses *straight javascript code to make a web page, unlike putting it between <script> tags in an HTML page. *HTML code may be put in a document.write() tag So there you have it- A "JSP" is a web page using *straight Javascript code.
  • JSP or Java server pages are normal HTML pages with Java code embedded in it.. ie applets and other stuff. Javascript which was developed by Netscape is just a language similar to Java used in webpages to add functionality. Javascript does not require a java runtime engine and is less stuctured than java as well as faster and easier to code.
  • Just to clarify on silverdarkness' answer, JSP pages are JavaServer Pages, which are a hybrid-mixture of regular HTML and unprocessed Java codelets - the server does the actual processing of the Java code before farming the finished version of the page out to the end-users. In this manner, JSP is similar to ColdFusion, PHP and ASP (and to a lesser extent, mainly due to its age, CGI/Perl, although the theory is the same). More information on JSP can be found on Sun's page (the developers of all things Java): http://java.sun.com/products/jsp/ For the aforementioned reasons (mainly the server parsing the raw pages and processing of the raw Java codelets before sending them to the user's browser), JSP is a 'server-side' language. Conversely, JavaScript is a 'client-side' coding language - its complexity is a lot simpler, and bears a few similarities to Microsoft's own VBScript (although JS and VBS can't do exactly the same things). VBScripts on pages are mainly relegated to company intranets' sites or IE-only versions of web sites, due to the fact that only Internet Explorer will parse VBScripts ;) You can code a function in JavaScript, embed it into your web page and call it, say, when the user's browser has finished loading the page. As JS has many hooks into the browser 'chrome' (the actual window interface around the web page), this function could do anything from resize the web page to specific dimensions, reload to another specific URL, display a custom scrolling text in the browser's status bar... JS can be made to perform remarkably-complex things, all hosted in the browser window - I've even seen realtime algorithmic Blowfish encryption and decryption done quite easily, which was something I'd never have expected to see four or five years ago. While JS can't do more advanced things such as server-side SQL database access held on a database server (so therefore can't dynamically-generate page content from a database), it could for example parse a URL given to the browser upon page load, strip out which variables in the URL are relevant and pass those to a server-side web page (maybe JSP, for example), and then the JSP page is parsed by the server, the server does the bulk of the work and then passes the results back to the browser. Sites such as Google Maps, and MANY of the recent crop of 'Web 2.0' sites use a technology called 'Ajax', which has its roots in JavaScript (the technology allows for dynamic updating of web pages without the need to reload the entire page every time you change something, which greatly improves the user experience). The shortcomings of JavaScript are that if you write a really complex script, and it works fine in one browser, it may or may not work in other browsers, depending on how similarly or differently they interpret JavaScript - there are some subsets of functions, and particularly in IE, there are controls for specific aspects of a page, or for formatting/positioning elements, which aren't available in Mozilla-based browsers (e.g. Firefox, Flock) or Opera... The simpler you keep your JavaScripts, the more chance you have of them running flawlessly. Taking IE for example, if you've ever been on a web site and you've clicked on something expecting something else to happen, but nothing has (and that little yellow error icon appears in the status bar), the browser's encountered an error parsing the script and can't continue. At this point, at least in my experience, the only way to reset the browser as such is to reload the page and reinitiate the script from a fresh start. So, as you've probably figured out from these descriptions, JSP being server-side has the advantage of being universally-compatible with all browsers, as all the legwork is done by the server which just then outputs a 100% HTML web page to be viewed by the client. With client-side JavaScripts embedded into pages, you can decrease loading times (as all the server has to do is send the page as it exists on the server, instead of parse it, compile any code on the fly and then send along the finished page). However, and this must be mentioned, with JS you encounter the dreaded cross-compatibility problem, something which all web content designers continually whinge about (me included!) Some functions and object identifiers exist in IE which don't in Mozilla, or the browsers parse and interpret the same code in different ways... It's a right pain in the arse. This often explains the reason for many web sites in the past having an 'IE version' and 'Mozilla version', although JavaScript can easily detect which browser you're using and you can then use that feature to silently change the web page to one featuring scripts which are wholly IE Compatible... But one of the beauties of Ajax is that it can do all this, and switch 'modes' as such, all without any user intervention, meaning that pages now look more uniform on a wide variety of browsers than ever before - but it's still a huge amount of legwork for the designers to achieve this! For more info on JavaScript, check the W3Schools pages: http://www.w3schools.com/js/js_intro.asp Erm, right... I think I've covered most of the important stuff. :)
  • JSP and JavaScript sounds similar because of the 'JAVA' in it but both are different and serves different purpose, firstly let me tell you about JavaScript Javascript - files are stored with a *.js extensions. - it is used for modifying and creating web pages using DOM and other powerful features. - it usually used as front end creation (web pages). - used on the client side to trigger an action. JSP (Java Server Page) - files are stored with a *.jsp extension. - it is used on the server side to generate web pages - the action triggered by the client side using web page (created using JavaScript)are responded by the JSP
  • when you run JSP, the web page has to call the server so you will get a refresh on your page. when you run Javascript the code runs on your computer via the browswer so there is no refresh to your page. Java and Javascript are completely separate languages and have nothing to do with each other. A JSP, Java Servlet Page is of the Java language

Copyright 2023, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy