The following instructions tell you how to load an installable web app that isn't yet packaged in a .crx file—a handy technique while you're working on an app.
1.Create a folder (you might name it maps_app) and put the following files into it:
You've just created the metadata for a hosted app. Now you can load the app.
2.In Chrome, bring up the extensions management page by clicking the wrench icon and choosing Tools > Extensions. (On the Mac, go to theWindow menu and choose Extensions.)
3.If Developer mode has a + by it, click the +.
The + changes to a -, and more buttons and information appear.
4.Click the Load unpacked extension button.
A file dialog appears.
5.In the file dialog, navigate to the folder where you put the app's files, and click OK.
You've now installed the app.
6.Create a new tab.
The icon for the newly installed app appears in Chrome's launcher on the New Tab page.
7.Click the icon for the app.
You've now launched the app.
For a full tutorial on converting your existing web app into a hosted app (and publishing it), see the Chrome Web Store Getting Started tutorial.
var els = document.querySelectorAll("ul li:nth-child(odd)");
We can use selectors to select elements in the document, Selectors can be CSS selectors or similar to Jquery selectors
window.localStorage['value'] = area.value;
We can store data in local database similar to google gears i.e how offline gmail works similar to that we can create many applications easily
var db = window.openDatabase("Database Name", "Database Version");
We can access stored data from local database
db.transaction(function(tx) {tx.executeSql("SELECT * FROM test", [], successCallback, errorCallback);});
We can execute SQL queries like above
main.js:
var worker = new Worker(‘extra_work.js');
worker.onmessage = function(event) { alert(event.data); };
extra_work.js:
// do some work; when done post message.
postMessage(some_data);
if (window.webkitNotifications.checkPermission() == 0) {
// you can pass any url as a parameter
window.webkitNotifications.createNotification(tweet.picture, tweet.title,
tweet.text).show();
} else {
window.webkitNotifications.requestPermission();
}
We can show notifications like "allow popup" dialog
We can drag and drop elements using JavaScript without any frameworks or extra js files (this was the feature i was looking for very long time )
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var lat = position.coords.latitude;
var lng = position.coords.longitude;
var options = { position: new google.maps.LatLng(lat, lng) }
var marker = new google.maps.Marker(options);
marker.setMap(map);
});
}
We can show the use from where the user is logged in using any map service or we can set the locale information according the geolocation
<div itemscope itemtype="http://example.org/band">
<p>My name is <span itemprop='name'>Neil</span>.</p>
<p>My band is called <span itemprop='band'>Four Parts Water</span>.</p>
<p>I am <span itemprop='nationality'>British</span>.</p>
</div>
We can differentiate the property of the each span