Tuesday, December 24, 2013

jQuery and JavaScript Phrasebook

jQuery and JavaScript Phrasebook (Developer's Library) 

Get more done faster with jQuery and JavaScript! Brad Dayley’s jQuery and JavaScript Phrasebook brings together 100+ instantly useful code snippets and idioms for performing a wide spectrum of common web application tasks. This hands-on guide gets straight to the essence of what’s new and important in jQuery and JavaScript, and what you need to know to build new web solutions or migrate existing sites to jQuery.

Building on JavaScript Phrasebook, Dayley presents carefully tested, flexible, adaptable code - all organized for quick lookup and easy use. Dayley’s coverage ranges from the basics to advanced jQuery capabilities, including jQueryUI widgets and mobile development. Coverage includes:
  • Basics, including selecting and manipulating HTML elements with jQuery Selector
  • Dynamically manipulating CSS values
  • Handling browser and DOM events
  • Performing validation
  • Server communication
  • REST, PHP, MySQL, AJAX, and JSON/XML data
  • Positioning web page elements and making them interactive
  • Using animation and other special effects
  • And much more
jQuery and JavaScript Phrasebook is the perfect quick reference for millions of web developers who want reliable solutions they can use right now -- with no distractions and no diversions!

Friday, December 20, 2013

Getting Started with the Google Maps JavaScript API

This is a series of four videos walking you through getting started with the Google Maps JavaScript API (http://goo.gl/JnoETx).

The series covers:
- Creating a map
- Getting a Maps API key
- Using the key and the loader
- Walking through the basics of the code

Expert JavaScript

Expert JavaScript is your definitive guide to understanding how and why JavaScript behaves the way it does. Master the inner workings of JavaScript by learning in detail how modern applications are made. In covering lesser-understood aspects of this powerful language and truly understanding how it works, your JavaScript code and programming skills will improve. 

You will learn about core fundamentals of JavaScript, including deep dives into functions, scopes, closures, and practical object-oriented code. Mark Daggett explains clearly how closures, events, and asynchronous code really operate, as well as conventions and concepts to write JavaScript in a clear, pragmatic style. Many of the changes in ECMAScript6 and its implications are all explained. You'll be introduced to modern workflow tools to make application development faster, more enjoyable, and ostensibly more profitable. You'll understand how to measure code quality and write more testable JavaScript, and finally you'll learn about real-world applications of JavaScript, including JavaScript-powered robots.

JavaScript is one of the most powerful languages on the web today, and it is only getting stronger. This book will take you through the process of planning, coding, testing, profiling and finally releasing your application, at expert level. With more frameworks and more improvements than ever, now is the time to become an expert at JavaScript. Make this journey - use Expert JavaScript today.

What you’ll learn

  • What is really going on underneath functions, in arguments, types, coercion, and scope
  • How closures, events, and asynchronous code work at a fundamental level
  • How to understand advanced topics including promise objects, coroutines, and generators
  • How to apply this newfound knowledge pragmatically to build the very best modern JavaScript applications

Who this book is for


This book is for the experienced JavaScript programmer who wants to understand the how and why of their code in order to become a better developer. This book is not intended to teach JavaScript at a syntactical level, but instead delve deep into the code - the philosophy, the reasoning and the detailed expert-level knowledge behind it. This newfound knowledge will enable the reader to build the very best modern JavaScript applications.  It is for anyone who wants to become a better programmer by understanding at a very high level how the code works.

Table of Contents

  1. Objects and Prototypes
  2. Functions
  3. Getting Closure
  4. JavaScript Slang
  5. Living Asynchronously
  6. JavaScript IRL
  7. Pragmatic JavaScript Style
  8. Workflow
  9. Code Quality
  10. Improving Testability

Pro Node.js for Developers

Pro Node.js for Developers

Since it’s creation in 2009, Node.js has grown into a powerful and increasingly popular asynchronous-development framework for creating highly-scalable network applications using JavaScript. Respected companies such as Dow Jones and LinkedIn are among the many organizations to have seen Node’s potential and adopted it into their businesses.

Pro Node.js for Developers provides a comprehensive guide to this exciting new technology.  We introduce you to Node – what it is, why it matters and how to set it up – before diving deeply into the key concepts and APIs that underpin its operation.

Building upon your existing JavaScript skills you’ll be shown how to use Node.js to build both Web- and Network-based applications, to deal with data sources, capture events and deal with child processes to create robust applications that will work well in a wide range of circumstances.

Once you've mastered these skills we’ll go further, teaching you more advanced software engineering skills that will give your code a professional edge. You’ll learn how to create easily reusable modules that will save you time through code reuse, to log and debug your applications quickly and effectively and to write code that will scale easily and reliably as the demand for your application grows.

What you’ll learn

  • Install, configure and deploy Node.js apps effectively
  • Understand the Node.js asynchronous programming model in detail
  • Create both web and network-based Node.js applications with ease
  • Learn to work effectively with varied data sources and file types
  • Discover advanced software engineering concepts that will will save you time and promote code reuse

Who this book is for

This book is for developers who already have a working knowledge of JavaScript and are interested in adopting Node.js into their projects. All other concepts will be introduced from first-principals.

Table of Contents

  1. Introducing Node.js
  2. The Node Module System
  3. The Event Loop
  4. Events
  5. Timers and Scheduling
  6. The Command Line Interface
  7. Accessing the File System
  8. Data Streams
  9. Binary Data
  10. Creating Child Processes
  11. Network Programming
  12. HTTP Server Development
  13. Connect
  14. Connecting to Databases
  15. Logging
  16. Application Scaling
  17. Appendix

Microsoft Project Siena, create Windows 8.x app without any programming

Microsoft Project Siena
Microsoft Project Siena (code name) is the beta release of a new technology for business experts, business analysts, consultants and other app imagineers. Now, without any programming, you can create powerful apps for the device-first and cloud-connected world, with the potential to transform today’s business processes.

• Apps to explore media-rich product catalogs and create ensembles that together serve a customer’s needs
• Apps used on the spot to resolve customer service bottlenecks and logistics exceptions, with the custom intelligence to help the user make local trade-offs
• Apps for auditing and inspecting a manufacturing facility through photos, videos and pen and voice notes, all tied to an asset database

Siena apps are as easy as editing a document. You place some visuals on a canvas. You hook them up to your data. You customize how your app looks and works. Then, if you need special logic and intelligence, you write some Excel-like expressions. You can use your app immediately, or share it with colleagues or the world.

With Siena, you can conceptualize, validate and build your app ideas almost as fast as you can come up with them. And if your needs change tomorrow, updating your app is no problem. Open it. Change it. Share it again, and you’re off to do business.

Siena works well with corporate and web data and media content: SharePoint lists, Excel and Azure tables, RSS feeds and the gamut of RESTful services.

Siena apps are just HTML5 and JavaScript and are deployed and managed like any other Windows 8.x app. In fact, developers can open them up, see what’s there and, if needed, extend them in their favorite programming tools.

Install Siena, watch one of the how-to videos at http://aka.ms/ProjectSiena, and then build the app that you’ve been imagining... in under an hour.

  • Conceptualize, validate and build your app ideas as easily as editing a document
  • Connect to corporate and web data
  • Compose rich interactive visuals to create custom, unique apps
  • Add business logic and intelligence using the power of Excel-like expressions
  • Use the app yourself, share with colleagues or with the world


Friday, December 13, 2013

Releasing HTML5 Games for Windows 8

Releasing HTML5 Games for Windows 8
Releasing HTML5 Games for Windows 8
Windows 8 presents an incredible opportunity for distributing and monetizing HTML5 games, and this guide shows how you can profit from it. You’ll learn everything you need to know about porting your original web-based JavaScript game to the new "touch-first" version of Windows, as well as several options for selling your game in Windows Store.
Windows 8 is a big leap forward for developers because it treats HTML5 as a first-class citizen, alongside C# and C++. Interactive development expert Jesse Freeman explains how Windows 8 works, gets you started with Visual Studio Express (it’s free!), and uses a case study to show you how to port an HTML5 game with ease.
  • Learn which games and JavaScript libraries work best on Windows 8
  • Adjust artwork for different screen resolutions and Windows 8 features
  • Accommodate mouse, keyboard, touch, and other game controls
  • Optimize your game to run well on any Windows 8 device
  • Understand the steps for publishing your game to Windows Store
  • Explore fixed price, trial mode, ad support, and in-app purchase options
  • Use a web-first workflow to ensure your game runs on many other platforms

Tuesday, December 3, 2013

Emulation in Chrome DevTools

You can now realistically emulate many device characteristics on desktop, saving you time and making your iteration loop much faster. You can emulate screen size, devicePixelRatio, and ❮meta viewport❯ with full touch event simulation. More at http://html5rocks.com/en/tutorials/developertools/mobile/

Sunday, December 1, 2013

Javascript exercise: duplicated variable name in global and local

This exercise show duplicated variable name in global and local:
  • my_var1 declared and defined outside function as global variable
  • my_var2 duplicated with local variable without defination.
  • my_var3 duplicated with local variable, load value before use.
  • my_var4 duplicated with local variable, load value after use
duplicated variable name in global and local
duplicated variable name in global and local


<!DOCTYPE HTML>
<html>
    <head>
        <title>Mobile-Web-App</title>

<script>
var my_var1 = "my var 1";
var my_var2 = "my var 2";
var my_var3 = "my var 3";
var my_var4 = "my var 4";

var testjavascript = (function (){
 console.log("Test Start");
 
 var my_var2;
 var my_var3 = "my var define inside function before use";
 
 console.log("my_var1: " + my_var1);
 console.log("my_var2: " + my_var2);
 console.log("my_var3: " + my_var3);
 console.log("my_var4: " + my_var4);
 
 var my_var4 = "my var define inside function after use";
 
 console.log("Test End");
});

console.log("testjavascript() run after document loaded.");
window.onload = testjavascript();
</script>

    </head>
    <body>
        <h1>Mobile-Web-App</h1>
        <h2>http://mobile-web-app.blogspot.com/</h2>
    </body>
</html>


Javascript exercise: variable can be accessed before declared

This exercise show that we can access variable before declaration without error, what it return is undefined. But cannot access variable without declaration, it will stop the javascript.

variable can be accessed before declared
variable can be accessed before declared

Example code:
<!DOCTYPE HTML>
<html>
    <head>
        <title>Mobile-Web-App</title>

<script>
var testjavascript = (function (){
 console.log("Test Start");
 console.log("use var before declaration: " + my_var);
 
 var my_var;
 console.log("use var after declaration: " + my_var);
 
 local_var = "Hello World";
 console.log("use var after value assigned: " + my_var);
 
 console.log("Un-declared var: " + another_var);
 
 console.log("Test End");
});
 
console.log("testjavascript() run after document loaded.");
window.onload = testjavascript();
</script>
    </head>
    <body>
        <h1>Mobile-Web-App</h1>
        <h2>http://mobile-web-app.blogspot.com/</h2>
    </body>
</html>