JavaScript types preparation for jQuery tutorial and Original From it
2013-06-10 19:17
465 查看
http://learn.jquery.com/javascript-101 This is really helpful for people to learn JavaScript. JS has nothing to do with Java actually !
And some JS data operationing methods are somehow very handy just like other programming languages such as PHP, python and etc.. You could find its awesome functionalities here http://learn.jquery.com/javascript-101/types/ . it's more like PHP while Python also has the method " one_array.pop " or something like that. Need to figure it out from Python Doc.
JS has one_array.pop() one_array.shift() and many other methods to manipulate array object.
Here is a brief difference and usage in jQuery . Easy shot :)
JS's basic Operators http://learn.jquery.com/javascript-101/operators/
JS's conditional codes : http://learn.jquery.com/javascript-101/conditional-code/
------------These are very useful to do some interesting convenient things.
------------e.g. var foo = bar ? 1 : 0; // if bar is truthy, then foo=1, or foo is assigned with 0
------------In python we have things like this. Figure it out yourself!
Objective_JS:
http://learn.jquery.com/javascript-101/this-keyword/
very interesting keyword : this :)
Paragragh which begins with the blow is very intelligent somehow :
Closures can also be used to resolve issues with the
------From http://learn.jquery.com/javascript-101/closures/
And some JS data operationing methods are somehow very handy just like other programming languages such as PHP, python and etc.. You could find its awesome functionalities here http://learn.jquery.com/javascript-101/types/ . it's more like PHP while Python also has the method " one_array.pop " or something like that. Need to figure it out from Python Doc.
JS has one_array.pop() one_array.shift() and many other methods to manipulate array object.
Here is a brief difference and usage in jQuery . Easy shot :)
// Checking the type of an arbitrary value. var myValue = [ 1, 2, 3 ]; // Using JavaScript's typeof operator to test for primitive types: typeof myValue === "string"; // false typeof myValue === "number"; // false typeof myValue === "undefined"; // false typeof myValue === "boolean"; // false typeof myValue === "object"; //true Coz type "array" is an object in JavaScript :) // Using strict equality operator to check for null: myValue === null; // false // Using jQuery's methods to check for non-primitive types: jQuery.isFunction( myValue ); // false jQuery.isPlainObject( myValue ); // false jQuery.isArray( myValue ); // true. this is better than that you're just informed it's an object only
JS's basic Operators http://learn.jquery.com/javascript-101/operators/
JS's conditional codes : http://learn.jquery.com/javascript-101/conditional-code/
------------These are very useful to do some interesting convenient things.
------------e.g. var foo = bar ? 1 : 0; // if bar is truthy, then foo=1, or foo is assigned with 0
------------In python we have things like this. Figure it out yourself!
Objective_JS:
http://learn.jquery.com/javascript-101/this-keyword/
very interesting keyword : this :)
Paragragh which begins with the blow is very intelligent somehow :
Closures can also be used to resolve issues with the
thiskeyword, which is unique to each scope:
------From http://learn.jquery.com/javascript-101/closures/
// Using a closure to access inner and outer object instances simultaneously. var outerObj = { myName: "outer", outerFunction: function() { // provide a reference to outerObj through innerFunction"s closure var self = this; var innerObj = { myName: "inner", innerFunction: function() { console.log( self.myName, this.myName ); // "outer inner" } }; innerObj.innerFunction(); console.log( this.myName ); // "outer" } }; outerObj.outerFunction(); // Try those codes out in your JavaScript console ( firefox preferred )
相关文章推荐
- jsDelivr - Free open source CDN for javascript libraries, jQuery plugins, CSS frameworks, Fonts and more
- A Beginner Tutorial for Writing Simple COM/ATL DLL and Using it with .NET
- Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
- [JavaScript] How similar it is with Swing, so it seems coding swing is very helpful for me
- Building JavaScript Games for Phones Tablets and Desktop(2)-游戏编程基础
- Herbal Cures For Acne - Use it and Lose Zit
- [文章摘要]iVizTRANS: Interactive visual learning for home and work place detection from massive public t
- Some 3D Graphics (rgl) for Classification with Splines and Logistic Regression (from The Elements of Statistical Learning)(转)
- Herbal Cures For Acne - Use it and Lose Zit
- Get image from URL and save it
- How to load 3d model from different domain and display it with Three.js
- SQL Script for select data from ebs and make a csv file to FTP
- JavaScript: DHTML API,Drag & Drop for Images and Layers
- What it means for machine intelligence and AI-Christopher Nguyen
- Apache Ant -a java library and command-line tool for building different types of applications
- Tutorial for building J2EE Applications using JBOSS and ECLIPSE(2)
- PhoneGap: open source development framework for building cross-platform mobile apps, Build apps in HTML and JavaScript
- Arcgis for Javascript 出现“init.js->TypeError: f is not a function”
- Project Management Nation : Goals for the New and Practicing IT Project Manager
- [必读免费新电子书]:JavaScript和jQuery基本设计模式(Essential JavaScript & jQuery Design Patterns For Beginners) 最后编辑:2010-11-16 18:15