Getting started with JSON-P

I have during my college days used XMLHttpRequest object and its equivalent in Microsoft world to make Ajax calls and those Ajax calls were to the URL within the same domain. But with the advent of Webservices and whole lot of mashups being developed, Ajax calls are not restricted to same domain but the cut acorss different domains. When this cutting across domain boundaries happens making Ajax calls using XMLHttpRequest fails due to security enforcements implemened by the browsers. That’s when the idea of JSON-P i.e JSON with Padding came up.

In this post I will quote from different sources about JSONP and then go ahead and implement example which invokes Stackoverflow API to retrieve the unanswered questions tagged ‘jsonp’

  1. What is JSONP?
  2. Simple example for JSONP
  3. Accessing Stackoverflow API using JSONP

Continue reading “Getting started with JSON-P”

Advertisements

HTML5 Geolocation API with Goolge Maps

I have been reading Head First HTML5 and read about the Geolocation support in HTML5 and also went through the example they have shared about using the Google Maps with HTML5 geolocation API. It was an interesting example and I went a step further and enhanced the example to show some eat outs around the current location. For this I made use of the Places library which comes with the Google Maps API.

In this post I will cover:

  1. Getting started with HTML5 Geolocation API.
  2. Integrating Google map to show current location.
  3. Enhancing to show nearby places on Google map.

Continue reading “HTML5 Geolocation API with Goolge Maps”

Birds Eyeview of Web track at the GIDS 2012

The main focus of the day was the emergence or in otherwords out growth of mobile devices over desktop/laptop in the Q4 of 2010. And also the importance of making the applications mobile compatible. With the advent of HTML5 and lot of browsers including mobile browsers providing support for these features, it gives much more power to the developers in creating rich applications for mobile and desktop browsers.

No wonder why lot of the sessions lined up focussed on HTML5 and Javascript. With HTML5, there’s lot more dependence on Javascript, because a lot of features like Application cache, Local storage, Location aware and others are driven by Javascript. And most of these sessions were by the best of the speakers- Scott Davis and Venkat Subramaniam. There’s not a better way to start the conference day than by attending Scott Davis talk. Just a brief summarisation of the talks:

  • A birds eyeview of HTML 5 features namely- Application cache and Local Storage. Local storage allows developers to store the client data in a key-value pairs (like NoSQL) and provides upto 5MB of storage which is much more than the cookies which provided 4KB. Application cache provides support for caching web content on the client, so your images, css, javascript can be cached. This is done by defining a manifest file and referring to it in the html. The good thing is that there’s no cap on the application cache size.
  • JavaScript from a different perspective- I always under estimad the power of JavaScript, never took it up for learning and the only way I got around it was by searching on the web for solutions and copying the code. But Venkat in his talk says- JavaScript is often misunderstood because of- the term ‘Java’ it carries with its name and because of the bad code available on the internet. Functional and Prototypal features of the language were demonstrated during the session.
  • Improving the page load times by using PageSpeed service. Interesting facts as to where the web page takes time to load were shared along with possible optimisations. I remember using PageSpeed to check the page load times for my blog, but I need to explore the PageSpeed service which does the optimisations on the fly.
  • Got to know about Backbone.js which is a JavaScript based web framework. Its a component based, asynchronous and client side MVC based web framework which supports creating single page web applications. The main idea behind single page is that the multiple pages are replaced by individual divs on the single page. And instead of controllers it has an concept called routers which route the requests to corresponding functions/callbacks. Lot of the concepts learnt in the JavaScript talk earlier were useful.

Now coming to the expo booths-

  • None of them had anything useful to share about the product there were displaying except for SafeNet,where the person in the booth explained exactly what the product does and was in a position to answer the queries.
  • ThoughtWorks were giving out ThoughtWorks Radar and the people in the booth were from the recruitment team, but I thought they should have got a developer or two there who could explain as to how Radar is prepared or may be talk a bit or two about few upcoming technologies or the technologies they are working on.
  • The funniest stall was the JetBrains where I guess the person was from the sales/marketing team and had no clue as to how JetBrains is better than Eclipse or Netbeans. I asked him few questions about the features in JetBrains and all he had to say was, please ask your company to get in touch with us, we will provide them live demo from US and before that talk about the purchase plan of your company. Now does that impress hundreds of developers who visit the stall?

Lot to explore tomorrow and the day after. Stay tuned for more updates here.

Web conferences at Great Indian Developer Summit 2011

My first day at the Great Indian Developer Summit 2011 was the Web conferences where in major presentations I attended were all about HTML5, RDFa, Microformats, jQuery and JavaScript. There was a PlayBook related key-note, the sad part of that key-note was that though the speaker had the PlayBook in his hand he didnt bother to show it to the audience. I have briefly listed the topics covered in the sessions I attended. Continue reading “Web conferences at Great Indian Developer Summit 2011”