Parsing prototype’s responseXML in JavaScript
Here’s a quick code snippet to parse the responseXML using JavaScript.
I am printing the xml file using php, feel free to use your server side scripting language.
First make a quick Ajax.Request call to send the data to server file.
function AddItem() {
var input = ‘myinput=’+$F(‘myinput’);
var list = ‘ListID=’+$F(‘ListID’);
var user = ‘userID=’+$F(‘userID’);
var pars = input+’&’+user+’&’+list;
new Ajax.Request(
‘GetItem.php’,
{
asynchronous:true,
parameters:pars,
onComplete: ShowData
}
);
$(‘myform’).reset();
$(‘myinput’).activate();
return false;
}
Now that we have sent the data to our server file, in the above case its GetItem.php
Print the xml file in the php side.
Collect the reponse from the server in the form of the responseXML.
Below is the code to parse the responseXML and picking it up in javascript DOM.
function ShowData(originalRequest) {
var xmlDoc = originalRequest.responseXML.documentElement;
var value = xmlDoc.getElementsByTagName(“ItemValue”)[0].childNodes[0].nodeValue;
var value1 = xmlDoc.getElementsByTagName(“ItemID”)[0].childNodes[0].nodeValue;
divID = ‘DIV’+value1;
var div = document.createElement(‘div’);
div.className =’ItemRow’;
div.id = divID;
var val = ‘”‘+value+’”‘;
var i = document.createElement(‘input’);
i.type=’checkbox’;
i.id=value1;
i.value=value;
i["onclick"] = new Function(“MarkDone(this.id)”);
var t = document.createTextNode(value);
div.appendChild(i);
div.appendChild(t);
$(‘ItemTree’).appendChild(div);
new Effect.Highlight($(div));
}
This has worked perfectly for me, let me know if you run into issues with this code.
Cheerz
Show your love for names…
At lunch in cafeteria, someone just sparked the topic of hillarious and witty movie titles.
And, we decided to compile the BIG Daddy list of movie titles which tickle and make you laugh.
List the names of movies you know off in the comments and we will keep updating this list here ..
Let me start here ..( updated list)
1. Khooni Dulhan ( 2001)
2. Daaku Ramkali
3. pyasa haiwan
4. tarzan ki beti
5. khooni darinda
6. rengthi chudail
7. Aag Lagaa Do Saawan Ko
8. DIL DIYA DARD LIYA
9. Rampur ki rani
10. raat rani
11. raat rani
Simplest solution to end corruption in India.
If I hear one more time gush over anti-corruption bills and laws, I swear, I’m gonna puke.
Team Anna says they want a strong bill so that they want to punish the corrupt officials. What if I were to tell you, there are proof’s/stings of politicians and middlemen taking bribes on camera?
Well, I am no journalist, nor from any media background and the last thing, I am not attached to any political party. It’s disclaimer.
I want to know, what and how are you going to deal with them?
Now to give you proof’s, please hop on to Tehelka.com and you will find some stunning and shocking truth.
I happened to go over, the Godhra Coverage and the Operation West End.
One simple google search on the same, and you will find tons of articles and interviews of Tarun Tejpal and wikipedia entries of the same.
After going over each one of them, I feel Team Anna has just wasted theirs and nation’s time.
If they would have known how the powerful people in delhi corridor’s react on such corruption issues, and what extent they went behind people exposing it, they would have never expected the elected representatives to pass a strong lokpal bill.
And, guess what happen’s to people who are caught in bribery? Well, is there any other “India’s Upcoming Hero’s Award lined up?”
My curiosity lingers me to raise few doubts about the media itself. I wonder why no one picked up these stories in main stream media? Television debates? Why was anna fast covered?
So that brings me to suggest, this nation of 100 crore+ people, my simplest solution to end corruption in India.
Instead of wasting time, money and energy in organizing, attending and travelling all cities to make people aware of the jan-lok-pal or jan-joke-pal, just raise power and money.
Bring in people who are powerful or can give money ( any amount) at their disposal and take all that money and power and invest in Tehelka 2.0
Let these good, daring and selfless folks at Tehelka 2.0 expose everyone and anyone who are corrupt and are county’s enemies. Then let loose media to follow up on these corrupt officials and finally, we can also do a candle light march ( that’s kinda in-thing now a days) to make sure guilty is punished.
That’s my solution. If you don’t have a better one, please get your cheques ready, should anyone decide to start a Tehelka again, we should be ready with boat loads of money and power.
Agree? Disagree? Feel free to express your solutions in the comments section.
With love,
One Among The Mango People.
A look back and looking forward : 2011 & 2012
31st Dec 2011, it started with laughing out loud and howling, as Roy had called and said, we are like train compartments and needs to be pushed all the times to get the things done.
God, it’s the last day of this year! “How was 2011?”, I asked myself. It’s 10am this morning.
**********************************************************************************
It was during Feb, we had this team outing and didn’t realize it was supposed to change life so much.
Met Suman, Roy and Khushi, my friends. They are the co-founders in HappyCV and Adsonomy.
All of us are so different from each other. How did we land up together?
Well, there’s so much we all shared together, some of our best moments of life together.
Right from long bike drives to sprite
from road side dosa to mainland china
from sharing family issues to abusing each other
from terrace parties to gold class movie,
It’s so long list of moments shared together. If I start writing them all, well it would certain, I would need to change the title to welcome 2013.
Time just flies, we never knew we would be this attached and close.
For us, we are better as nuts with each other, we know it and some part of us will always be that.
Being in our mature years( not that we are “old”), but behaving like college kids is some fun.
Not worrying, not even for a second, just knowing someone is always there to always count on. And more so we spent most of our time together.
We are a rare mix of class and country fellows, which is good, we used to be, what we wanted to be.
They say, opposites attract( who said it, anyway?), for us, we never realized if we are same, opposite, similar, different or same. We just did all we want, and best part is, we loved it.
Rarely, we got into arguments or fights, which ended up in good note, as we would realize and come back again.
It’s just the thought, that we always had someone to fall back on. And that is what made 2011 very special.
Personally, for me, I have changed a lot. I have learnt a lot of these friends and words are surely not enough to Thank you for all the smiles, happiness and love.
2011 will be cherished as a year of friendship, love and care.
*********************************************************************************
Some of the things, which made 2011 very special …
Meeting Kushi & Suman
Booking our house
Starting HappyCV and Adsonomy ( there is still long way to go, we have started our journey)
Changing job
Mohit chauhan’s concert
Nonu’s first Bday ( and remember, the shopping we did?)
Nonu flying first time in flight ( lil one is daring, you see)
Calling people at 1.30 am
Video calls on gmail..
There are so many, but these are some of the special moments.
Thank you, Roy, Suman and Khushi, if not for you guys, 2011 would surely would have ended up like another year.
************************************************************************************
Shit, I need to go to Gurudware and I am already late.
It’s the 10th Sikh Guru, Guru Gobind Singh ji’s Bday, Ah, on 31st. Awesome I said to myself.
Well, Nanded is the place where the Guru’s body is there and I also happen to graduate from the same place, SGGS Nanded college.
Suman, my punjabi bro, called me one week before to remind of this, I was not sure then but was today.
And, one thing, that makes me motivated and charged is to do seva.
Many of my friends had called asking me to join them, for clubbing, partying and having great time, which would just mean ending up doing nothing.
So i decided to head to Gurudware and what happiness we get in doing seva, can never be described nor felt. Do it to know the joy of it.
When the world was busy lifting their glasses, we were busy lifting 10kg rice cartons and making Raita. When the world didn’t bother who would wash was their plates, we cleaned containers and deg’s so huge and heavy in which langer is cooked and cleaning the kitchen, as big as some clubs dance floor.
Now, if you are giving a “awww” feeling, as you heard, ” washing, sweeping and cleaning stuff” , there was some big shots doing the same and you will not believe if i mention the names. So let’s keep it simple, all just do seva to guru in anyway we can, if that is “awwww”, just read next line and grab your masala chai.
Masala chai, was our beverage.
Some of the above tasks, multiple times. It tests your patience, body, strength and above all willingness to do seva.
The world would hug and wish Happy New Year, for us, we joined in Ardaas ( prayer) and putting our forehead in front of the Guru and thanking him for everything he gave this year and seek his blessing and love be on everyone for the coming year.
More masala chai, this time with more garlic, sugar and biscuits.
Wished Sister, Bhushan, Khushi and Roy and then went to grab quick sleep at 1.40am.
It rained, I guess, it was damn cold, and bless the mosquitoes had feast out of me.
Well, next morning, which for us was (3am), we had to get up again to prepare langer, and the year it is starting, my fav dishes was on menu for breakfast.
I got chance to help in with 160 litres of milk and 80 litres of curd from the milk vendor.
We quickly cleaned up the whole kitchen, utensils and huge containers so that the sevak’s can start their cooking.
Quick sleep again.
Got up, and more masala chai, this time with parathas and gulab jaamuns.
After serving the morning breakfast, I decided to enjoy the yummy first breakfast of 2012.
Me and Suman, truly enjoyed the first breakfast of 2012, aha, awesome, wonderful, so tummy full, we found difficult to carry ourselves.
Wished and thanked everyone at the langer, specially Sonu, Vicky, Karigar, Pinku, bhupinder and guys whose names I don’t know but trust me, when we meet each other next, anywhere, we would hug and say, “Wahe guru, aur veer ji, ki haal hai?”
Special mention and shout out for my younger pra, Suman, Thank you. I know I need not say it to him, but it’s out of care and love for him. God bless you.
After returning home, wished everyone in family and friends, if I missed anyone, please be assured, you are part of me, and were part of my prayers too.
I wish and pray, may god bless you and shower his blessing, love, happiness and care always to you.
*******************************************************************************
Welcome, 2012.
Let’s live our dreams, knowing we have such gr8 friends always there and are blessed from god.
Bring it on!!!!
********************************************************************************
PS: If you are in groovy mood, check out this http://www.youtube.com/watch?v=VAfY-OCcqNs&ob=av3n
Welcome Change and 2009!!!!
What a terrifc year 2008 has been with so many ups and downs!!!
But above all raise a toast to say Goodbye 2008.
And, I remember making few resolutions on 1st Jan 2008 …and when I look back today I am happy but not satisfied.
I have been really busy with lot of things both at personal and professional levels. Some of which I will be writing in due course of time.
Whatever happens, Happens for good. So let’s believe whatever happened in 2008 happened for good and we shall see the positive results in 2009.
So let’s welcome 2009 with more confidence, love and smiles.
I wish all you of and your families a very happy and prosperous new year.
Cheerz
Shri
PS: Back in business
Introducing iWinkr Studio
Ok apologies as I could not write for such a long time.
I took my own sweet time to sharpen skills, polish my courage and above all to dream BIG.
Allow me to introduce to you iWinkr studio
We will soon be launching some simple yet useful products too.
And, yes I promise to write more often now…
Cheerz
Shri
Looking for Open Source Charting system? Here it is
After a bit of research and trying with different charting and reporting libraries in Java, C++ etc, I finally found a library which is not only powerful but extremely simple as well.
I must tell you, I have started using it and it is damn good.
The best part being that it has so much of native support to PHP that anyone who loves coding in PHP should fall in love with this graphing library.
VIsit the above URL link and see some demos of how good it is
Did I tell u that it is totally free, even for commercial use? Simply Awesome. Go check it out.
Cheerz
Shri
If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.
The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.
CHECK out and BUY the PHP and Script.aculo.us book {My Book} at Packt official site
http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book
SUN acquires MySQL!!!!
For all those who love Open Source this news should come exciting, SUN Microsystems has acquired MySQL AB, the company behind the world famous open source Database.
As I see, SUN is merging strong in Open Source with Java, Sun Office, Solaris and Now, Mysql. It sure is here to play a big game with Open Source. IT wud be surely interesting to wait and watch how SUN tries to capture the market.
SUN has already ignited with Start-up essentials and to that package,mysql is a bonus.
Cheerz
SHri
IE really Sucks!!!!
Internet Explorer really sucks when it comes to executing JavaScript. I shall detail u d problem as well as d solution {If I find}.
But, for now join me in abusing MS for such a creepy IE stuff
Cheerz
SHri
If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.
The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.
CHECK out and BUY the PHP and Script.aculo.us book {My Book} at Packt official site
http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book
Wishing everyone a very Happy New Year!!!
2007 will soon die in next few hours, leaving us with loads of memories. Some of them good times, some really tough.
I am Looking forward for life in 2008.
Wait a min, say a quick Prayer, and Now, raise a toast, and Cheeeerzzz 2008.
Wishing You and Your Family a very Happy and Prosperous New Year ahead!!!
–Shri
One of the best Indian Bands: Indian Ocean!!!!
Indian Ocean is probably one of those Bands who not only give importance to music but to words as well.
The right mix of the rock-style jazz and classical touch makes them my best Indian Band. Susmit Sen, Rahul Ram, Asheem and Amit together can really compose some mind blowing music. I kinda speically like the vocal of Rahul Ram, which is very heavy and suits both western as well as Indian classical songs.
Have any doubts?
Check this video out…I am sure it will touch you.
Cheerz
Shri
Learn how to play with Flash, Mysql & PHP
Its one of those cool tutorials I have ever come across. It helps us in understaning how to integrate and play with Flash, Mysql and PHP.
I am sure it would help you too.
http://www.creativecow.net/articles/brimelow_lee/php_mysql/php_mysql_flash.html
Cheerz
SHri
If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.
The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.
CHECK out and BUY the PHP and Script.aculo.us book at Packt official site
http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book
Blog Reads….
Since, I am not updating my blog regularly now a days of course, you know I am busy
Anyways, by that time, you can have look at these blogs, I hope you would like reading them.
Web Analytics India Blog : A blog about the latest growing trends in analytics wrt India. {Its written by Anil, a fellow barcamper and friend}
Its a Free World : Ever imagine, whats happening around us? I know lot of mess. But then what we can do to solve it? Can we make our Ideas work to help humanity? Neha and Poonam, Exploring the unexplored zones.
If you have more interesting blogs to read, share with us.
Cheerz
Shri
Simple Ajax with YUI!!!
For those of you, who want to get started with YUI and Ajax, this would surely prove helpful.
<html><head>
<title>Lets learn YUI</title>
</head>
<body>
<div id="mydiv">
Add some Text or Images if you want to replace dynamically</div>
<a href="Loading.html" onclick="return YUI();">My first AJAX</a>
<script src="build/yahoo/yahoo-min.js" type="text/javascript"></script>
<script src="build/event/event-min.js" type="text/javascript"></script>
<script src="build/connection/connection-min.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function YUI(){
var loadUrl = "Loading.html";
var callback = {
success: function(o) {
document.getElementById('mydiv').innerHTML = o.responseText;
},
failure: function(o) {
alert("AJAX doesn't work"); //FAILURE
}
}
var transaction = YAHOO.util.Connect.asyncRequest('GET', loadUrl, callback, null);
return false;
}
//]]>
</script>
</body>
</html>
This is how one can simply make AJAX calls using YUI. The code is simple and self explanatory. If you need any help with this, please drop in comments.
Cheerz
Shri
If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.
The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.
CHECK out and BUY the PHP and Script.aculo.us book at Packt official site

http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book
Quick Code for Rounded Corners using Rico!!!!
Quick Code is a new category in my blog, where I shall share the code with lil details
<script type="text/javascript" src="./scripts/prototype.js" language="JavaScript">
</script>
<script type="text/javascript" src="./scripts/rico.js" language="JavaScript">
</script>
<script type="text/javascript">
Rico.Corner.round('ID of ur DIV',{compact:false,blend:false,corners:'all'});
</script>
Code is self explanatory,you just need to pass the ID of the DIV u need make it Rounded Corner. Extra parameters you can pass are Color, etc which of course are optional
Cheerz
Shri
If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.
The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.
CHECK out and BUY the PHP and Script.aculo.us book {My Book} at Packt official site
http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book
