Archive | Web 2.0 RSS for this section

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

Yahoo SDK & YUI are simply awesome!!!!

I must appreciate the fact on how much Yahoo gives freedom and power to developers through libraries and toolkits.

I am currently using YUI and Yahoo SDK for building a small application and I am highly impressed with the libraries.

For sure Y! are doing great job, making our life lil more simpler 🙂

I have been using some libraries like Rico, scriptaculous, Dojo and trust me when I say, YUI stands tall here.

If you havent tried it yet, get yourself hooked on http://developer.yahoo.com. Loads of tutorials, code, demos. For FREE

Try it now…

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

Im coming to Yahoo Open HackDay!!!! R u?

Yup, I am coming to Yahoo Open HackDay. I got a confirmation from Yahoo about this today.

So, now what next? Think of an idea we can build during those 2 days and enjoy it.

I have thought of a small widget kind of an application called “Mini-Yahoo”

If you also have got Invitation for HackDay, please drop me a mail. we can discuss on the idea and build it.

CHeerz
Shri

PS: Did I tell you, hacking in Taj Residency could really be fun!!!!

30 Day Project : Starts Today!!!

“Leave complex problems to BIG people, try to solve simple-small issues”

Yes, thats exactly what I am starting today. NO big deal. Just simple applications.

To start with today I got hooked with a small problem. So I got this idea.

I wont reveal much of what the app will be, what it shud be, or how I wud be wasting my time 🙂

The idea is to get something UP & Running,Quickly, very Quickly and then can keep on improving it!!!!

So write to u in detail on 15th September!!!

Keep guessing!!!!
Cheerz
Sridhar

<Hint>No Rocket Science, it has something to do with IndicComputing!!!!! </Hint>

37Signals vs TechCrunch : A Ridiculous debate!!!!!

Michael Arrington of TechCrunch has gone crazy to post such an article attacking 37signals, which has led to heavy debate over web.

The debate is about should software be given free or should be charged?

Michael says it should be free and I guess he probably mis-understood, the concept of 37signals. 37Signals has a array of web based simple applications some of which are free and some of which are paid services.

Yes, you cannot charge every software product, but if some products have extra features, value and above useful stuff. Why wudnt anyone pay?

Give free version of your product, if people like it and find it useful, they would surely want to have a Paid version of the same.

I mean if you cannot ask people to “Pay-N-Search’ but it is not applicable. But, project management suites need more security, features and simplicity. So they can be charged.

What do u think? Should software be free? or charged?

Drop in comments……

<span style=”color:#008080;”><em>If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored. </em></span>

<span style=”color:#008080;”><em>The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.</em></span>

<span style=”color:#008080;”><strong>CHECK out and BUY the PHP and Script.aculo.us  book {My Book} at Packt official site</strong>
<a title=”PHP and Scriptaculous Book” href=”http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book”&gt; http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book</a></span&gt;

How to learn Programming????

Most of the time, I hear people saying I am NOT good at programming but at “XYZ”, yes this is completely okay, but if you have some inclination towards learning programming or be a good programmer, here are few simple tips, I follow them so I thought I would share with you pals.

1. Join some Developer Network.

With lot of developer network platforms, half-of the work of the developer is already done and distributed in the form of “Packages”.

Im hooked to Yahoo Developer Network, for many reasons. One, it supports all the languages be it .Net, Java, PHP, Python etc etc.

More reasons for using any Developer Network, I can feel are

1. Cross Browser compatibility, one doesnt have to worry about the small issues of browsers

2. Loads of tutorials, code and examples

3. Forums and discussion boards

You can even learn a lot by looking at the code, examples and tutorials.

Some of the developer networks available are

1. Yahoo Developer Network

2. Google Code

3. Facebook Developer Network

4. Script.aculo.us Network

If you have used or know of any other developer network, drop in comments.

Cheerz

Web Design Tip #4: Using ToolTips Helps a LOT!!!!

ToolTips are really useful. If you are considering of making a web start-up. This tip would surely come in handy.

According to wikiperdia:

” The tooltip is a common graphical user interface element. It is used in conjunction with a cursor, usually a mouse pointer. The user hovers the cursor over an item, without clicking it, and a small box appears with supplementary information regarding the item being hovered over “

Where can we use ToolTips?

Most of the time, designers are not sure when we should use ToolTips. Lets us imagine a scenario where in user has to fill details. It would be really nice to put down a form tooltip to guide user on do’s-n-dont’s.

UserName <input type=”text”>

Now, if we apply a form tooltip, at the right-hand side a tip would appear when the user clicks on the text box.

“Choose username as smart as ur”

This not only helps in guiding the user about the details but also helps in creating humor 🙂

Which are the free ToolTips we can use?

Im using YUI{Yahoo UI library} and it has some really powerful features for tooltips. Alternatively one can also use the below mentioned libraries which can surely help in grooving the UI.

1. ProtoTIP : Simple, sleak, beautiful, can add effects and AJAX support. Good for Prototype+ Scriptaculous libraries {Im using it as well}

2. Ask The CSS Guy : ONLY useful for forms

3. Nifty Corners Cube: Awesome library perfect for all rounded-corner needs

4. Last but not least, Google it 🙂

If you know of any other library, drop in comments, I shall update the post.

Related Posts:

Web Design Tip#1: Yellow Fade Technique

Web Design Tip#2: Alternative Row colors for Rowset

Web Design Tip#3: Epicentric Designing

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