Java scriptforjavadev part1

276

Published on

Javascript Essentials for Java Dev

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
276
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Java scriptforjavadev part1

  1. 1. JavaScript Essentials For Java Dev Mak Bhatamrekar http://www.meetup.com/myajip/
  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 http://www.w3schools.com/jsref/obj_window.aspdocument Represent HTML Document http://www.w3schools.com/jsref/dom_obj_document.asp http://jsfiddle.net/mbhatamb/uXgEa/DOM Document Object Model, Internal represetation of the html document in browser. http://csszengarden.com/onLoad() Event http://jsfiddle.net/mbhatamb/Bq9Ke/ <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 http://www.w3schools.com/js/js_comparisons.aspFunctions Vs function myfunc(){ //body}; or var abc = function(){}.Function (second is called as functionexpression, and cannot beExpressions invoked until loadded. E.g http://jsfiddle.net/mbhatamb/cX5CP/
  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 http://jsfiddle.net/mbhatamb/pzXtd/ ** Can be a good ChallengeCall() and apply() Special way to invoke methods in others Objectsmethods pretending to be methods of our own object http://jsfiddle.net/mbhatamb/ptjea/ ** Can be a good Challengetypeof var myvar=5 alert(typeof myvar) //alerts "number”. Also used, if a javascript is not loaded e.g http://jsfiddle.net/mbhatamb/VXMUP/
  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&AcareerInJava.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×