On demand javascript “an AJAX alternative”
April 28th, 2008 Filed Under Good to know, Javascript, Technology, Tips & Tricks, json
AJAX … sounds to be very sophisticated, powerful buzzword for last 3 years which helps in data transfers done without reloading the web page.
But if we really think, we hardly use the ‘X’ part of AJAX; Meaning we do not pull xml data from the server but we generally pull some JSON data or strings and then process them and manipulate the displays.
If you think we don’t use the ‘A’ part of it too most of the times. I mean the Asynchronous part.
So what we use AJAX is for downloading some strings without refreshing the page.
If that is all what we need, then we can opt for a simpler solution called “On-demand-javascript”.
It is very simple to understand.
Create a script block with a src set to some server side dynamic entity(.asp, .jsp, servlet, .php etc) which in turn will send some JSON data in turn. For example:
<script type="text/javascript" id="dataBus" src="/myServlet.do?action=init"></script>
The above script node may establish a connection with the browser and set a session cookie.
Depending upon some event on the page, we can use the dataBus to pull some data from the server for us(it will just work like a pipe for us):
document.getElementById('dataBus').src="/myServlet.do?action=transfer&type=address&dateTime=utf-6556554351516";
The above code may pull some JSON data for us and once it is loaded our subsequent javascript code can use the received data.
The features/benefit of this approach would be:
- No cross domain constraints.
- Synchronous delegation.
- Already evaluated JSON data.
- You need to just place your data and don’t break your head in making-up a valid javascript object even if it is a string.
There can be a well lot of patterns for using the transported data and making data delivery secure around this approach.
But I am not telling you to forget AJAX. Because when you need to send some information using post method to your own server, this trick will not help you.
So the next time when you plan for some AJAX data pull, just consider this approach as an option and compare which one is worth for you.
Post Linx
Permalink | Trackback |
|
Print This Article | 1 Comment
Voice based search in Hyderabad
April 25th, 2008 Filed Under Good to know, Technology, comparisons, gyan
Google has launched yet another great utility; The phone based search in Hyderabad for local searches about movies, restaurants and other petty/large businesses.
This is the way it works: You call 180041999999 and ask about a Chinese restaurant and then ask google to forward your call to that restaurant to book a table for you.
But this service is not very much different from justdial service already there in all the major cities of India.
Post Linx
Permalink | Trackback |
|
Print This Article | Leave a Comment
Planning for watching movies in India?
April 25th, 2008 Filed Under Good to know, Tips & Tricks
Google has launched its movie search in India on google.co.in/movies.
Try http://www.google.co.in/movies for searching for a nearby theater and suitable timings for your favorite movie.
It also tells the address and name of the theater.
Not only that you can read the reviews and ratings too for the particular cinema, but somehow its not working for the co.in version.
What I am actually looking for is the linkage for the online booking of the cinema tickets within google search.
Post Linx
Permalink | Trackback |
|
Print This Article | Leave a Comment
Skin for shopping.aol.com
April 18th, 2008 Filed Under CSS, Javascript, browser, snippet, utilities
Using Greasemonkey, I have tried to skin http://shopping.aol.com. The skin is only for the homepage. This is just a try and beginning to mySkins project for firefox. I am thinking to build a plugin which will be a collection of skins for different websites.
To use this skin you need to have Firefox 1.5 or higher and Greasemonkey (Check your popup blocker if you have not seen after clicking this link… If you see the blocker .. click edit options and click on allow button) already installed.
Once you have both of these, download the script from here. And visit http://shopping.aol.com.
Post Linx
Permalink | Trackback |
|
Print This Article | Leave a Comment
Scale for Internet Explorer
April 10th, 2008 Filed Under Tips & Tricks, browser, utilities, vivek
A year back I created an internet explorer tool to measure the dimensions and positions of the page elements.
I named it “Scale IT”.
Please get the file here run the exe. After that you need to restart your browser(close all the instances and open a new IE window).
Now open any website and right click on the page and select “Scale IT” from the context menu.
For the first time it will take few seconds to load the necessary files.
Then press ctrl on you keyboard and do a mouse drag.
There is a help popup also that gives some necessary information for using the tool.
BONUS:
You also get a context menu called “Open in Firefox” … which opens the current web page in Firefox(if preinstalled).
I hope these tools will help in day to day work.
Please forward this tool to all of your friends you know and who need to measure images or any elements on the page.
Please help me debug this tool. If you come across any bug please email me or comment on my website.
Post Linx
Permalink | Trackback |
|
Print This Article | Leave a Comment

