Java scriptforjavadev part1


Published on

Javascript Essentials for Java Dev

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Java scriptforjavadev part1

  1. 1. JavaScript Essentials For Java Dev Mak Bhatamrekar
  2. 2. Agenda JS Development Tools Part1 - Core Javascript Concepts Part2 - JSON and JS Classes JQuery & Ajax How to Optimize JS
  3. 3. Dev Env Project setups using Eclipse IDE Sublime Text2 Editor Firebug Debugging Fast development with JSFiddle Fiddler HTTP Proxy
  4. 4. JavaScript Part1Essential Skills Java Developer should know
  5. 5. What is JavaScript Browser Only understands Html(Content) , CSS(styles), and Javascript, It’s a Scripting language, runs on client, gives the capability to change HTML/CSS dynamically. Initially used only from  Client Side Validations, Animations,DOM Manipulation  but now, we can develop Enire UI client with html,css,JS and connect to backend using AJAX, JSON.  Jquery and MVC Frameworks like Backbone, Angular,Amber to name a few are getting more popular.
  6. 6. Javascript NotesObject DescOOPS In JS everything is an Object except null,undefined,boolean,number and string.window Top level object which repesents browser window. Has document, history objs in it Represent HTML Document Document Object Model, Internal represetation of the html document in browser. Event <body>, <frame>, <frameset>, <iframe>, <img>, <input type="image">, <link>, <script>, <style>
  7. 7. Javascript Notes Contd.Object DescWhen to Load Define the script at the end of body, while CSS in head <html> <link rel="stylesheet" type="text/css" href="/css/normalize.css"/> <body> <html tags>.. <script > //your javascript</script> </body> </html> Esp. 3rd Party ScriptsOperators 5==‘5’ for compare and 5===‘5’ (false) for strict compare Vs function myfunc(){ //body}; or var abc = function(){}.Function (second is called as functionexpression, and cannot beExpressions invoked until loadded. E.g
  8. 8. Functions Functions are first class objects in javascript. Functions can have properties You can store a function in a Variable You can pass a function as a param to another function You can have annonymous functions and function expressions
  9. 9. Javascript Notes Contd.Object Descclosures Closure is the local variables for a function - kept alive after the function has returned, e.G ** Can be a good ChallengeCall() and apply() Special way to invoke methods in others Objectsmethods pretending to be methods of our own object ** Can be a good Challengetypeof var myvar=5 alert(typeof myvar) //alerts "number”. Also used, if a javascript is not loaded e.g
  10. 10. Quiz Why do I need client side validation when Server side is there and vice versa. What is DOM Main methods to traverse DOM? What is Window.onload() and Documend.onload() When should I access my Document Object When to load JavaScript and CSS What are Global Variables How to access Arguments of a function What is arguments.callee() What is Closures and Why?
  11. 11. Thank You  Q&