Archive for the ‘ Web ’ Category

49 Innovative Calendars for 2010

It’s that time of the year again when we kick off our shoes from work and enjoy the festive season. As we welcome the year ahead, I’m sure most of us have made some kind of resolutions for ourselves.
you will be looking at your new calendar for the new year for the next 365 days. Why not get a thought-provoking, creatively designed or aesthetic calendar that you can appreciate each and every day? Hongkiat have compiled some of the best designed calendars over the recent years to let each of you have an idea on the variety of calendars that designers have came up with.
calendar

Read more/ see more >>

A Colorful Clock With CSS & jQuery

A wonderful clock design explained on tutorialzine site using css & jquery.

clock

Read more >>

Click and Increase the Size of an Image using jQuery

The article on dotnetcurry demonstrates how to click and view a larger image when the thumbnail is clicked on.imageincrease

Read more on dotnetcurrey.com

How to disable the right click using jQuery

Some of us might want to disable the mouse right click .Below simple code snippet can be used to d the job easily using jQuery.

$(document).ready(function(){
$(document).bind("contextmenu",function(e){
return false;
});
});

Plurk gets sudden spurge of traffic due to unexpected free publicity

Plurk could have not asked more than this.
Canadian startup Plurk, a Twitter-like social networking site that has gotten quite popular in China, accused Microsoft China of not only stealing the service’s design, but 80 percent of the service’s code too. In response, Microsoft has pulled its microblogging site, which goes by the name of Juku and was developed by a third-party vendor for the company’s MSN China joint venture.

Plurk has been busy this week, attracting the attention of Social Media evangelists, most who are current Twitter users.This is the best thing that could have happened for plurk due to the outburst.
We are showcasing the few statistical analysis of traffic growth from alexa:
plurk1
plurk2

Plurk saw more than 50% increase in traffic& 200% in alexa traffic rank.

50 Beautiful Free Icon Sets For Your Next Design

Beautiful Free Icon Sets For Your Next Design is on smashing magazine.Go grab it!
…Round-ups of beautiful and useful icons are almost legendary on Smashing Magazine. While some readers complain about the annoying “list”-style of some of our articles, we are confident that useful round-ups of relevant resources are very valuable and useful for designers. This is why over months we collect useful links and then present them in posts in the magazine. Like it or hate it, but the feedback that we get from the design community when we publish such posts is mostly positive which is why we keep doing it.More>>
free-high-quality-icon
Image source:Deviantart
Read More >>

How to parse XML data using Jquery

Due to the increase in popularity of Web 2.0 applications and web services it has become increasingly important to be able to parse XML from the client browser.Parsing is not the easiest thing till the JavaScript libraries that supports XML made their way.

With jQuery, when you receive an XML from a callback (usually thro’ Ajax) which is basically a DOM (document object model) that jQuery can traverse seamlessly and efficiently to get the data you need.
we are using jQuery to parse XML due to its ubiquity& for cross browser compatibility.

The below xml file is used for reference.

<?xml version="1.0" encoding="utf-8" ?>
<country>
<state>
<city>Bangalore</city>
<id>24378</id>
</state>
<state>
<city>Chennai</city>
<id>42378</id>
</state>
<state>
<city>Mumbai</city>
<id>324782</id>
</state>
<state>
<city>Hyderabad</city>
<id>6524</id>
</state>
</country>

To parse the xml file we’re going to set up a function that will search each parent element and output the specified child element’s value as text using the find and each statement.The xml data gets parsed on success of ajax callback through parseXml function.Don’t forget to set dataType as “xml” while making an ajax call.
$(this).find(”city”).text() represents the textual value of city by striping the city tags -<city> &</city>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>xml parser using jquery</title>
<script type="text/javascript" src="/jquery-min.1.3.2.js"></script>
<script type="text/javascript">

$(document).ready(function() {
$.ajax({
type: "GET",
url: "/statecity.xml",
dataType: "xml",
success: parseXml
});

function parseXml(xml) {
$(xml).find("state").each(function() {
//Loops through each state & find's respective instance of city & id in the xml file

$("table#Citylist").append('<tr><td>'+ $(this).find("city").text() +'</td><td>'+$(this).find("id").text()+'</td></tr>');

});
}
});
</script>
</head>
<body>
<table id="Citylist">
<tr ><td >City List</td> <td >ID</td><tr>
</table>
</body>
</html>

The output would be displayed as below after parsing the xml file:

The City List ID
Bangalore 24378
Chennai 42378
Mumbai 324782
Hyderabad 6524

For the below html code snippet ,we can retreive the selected(checked) checkbox values into an javascript array for further processing.

<div>
<input type="checkbox" name="list_group" value="one" />
<input type="checkbox" name="list_group" value="two" />
<input type="checkbox" name="list_group" value="three" />
<input type="checkbox" name="list_group" value="four" />
<input type="checkbox" name="list_group" value="five" />
</div>

jQuery code to be used on onready or onclick event.

var values = new Array();
$.each($("input[@name='list_group']:checked"), function() {
values.push($(this).val());
});

How to create a for loop in jquery

Javascript for loop:
for( i=0; i < myArray.length; i++){
myArray[i];
}

jQuery for loop:
jQuery.each(myArray, function(i, val) {
val;
});

jquery each function acts as a looping function where "i" acts as a iterator & "val" gives the respective positional values of an array.