Feeds:
Posts
Comments

Archive for January 3rd, 2011

Greetings !

Today at our office i was asked to develop a calendar application in JQuery

I just heard the name and never played with JQuery

To give a try, i just started to get an introduction of it

Visited w3schools simple tutorial http://www.w3schools.com/jquery/default.asp

Woww….i wondered the effects, magics of JQuery..

Edited and Exceuted the programs given in that tutorial

This is my first time i was attracted by a library than any other

How to include jQuery library in to your code ?

Steps :

1. Download the jquery.js from here http://docs.jquery.com/Downloading_jQuery
( i downloaded 1.4.4 Uncompressed one )

2. Include the following code in head section of your html file

<head>
<script type="text/javascript" src="jquery.js"></script>
</head>

3. Try and execute a small program from w3schools to verify the working of jQuery library

 

 

Read Full Post »

Hai today a special day for me at Slashprog Technologies because its the first day of the year 2011

I thought tocontinue my calendar application.

I showed the application to my mentor Thyagu sir.

He asked me to convert the application to JQuery.

Since i dont know the a,b,c’s of JQuery..i initiated to learn JQuery from here http://www.w3schools.com/jquery/default.asp

Within an hour i became big fan of JQuery 🙂

I edited and executed all the programs in the tutorial

Im surprised to see the effects of JQuery

By 3.45p.m. we had a scrum meet and i told that i had learning curve with JQuery

So, by tomorrow i have to develop the calendar application in JQuery

Read Full Post »

Greetings !

This is going to be my first post of this year

While developing a calendar i gone through the methods in javascript library to display the first day of any month for any year.

Here’s the javascript code to display the first day of a month


<html>
<head>
<script type="text/javascript">
function getFirstDay (date,month,year) {

var dateObj =  new Date();
dateObj.setFullYear(year);
alert(dateObj.getFullYear());

month_names = new Array("January","February","March","April","May","June","July",

"August","September","October","November","December");
dateObj.setMonth(month);
var m_name = dateObj.getMonth();
alert(month_names[m_name]);

day_names = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
dateObj.setDate(1);
var first_day = dateObj.getDay();

alert(day_names[first_day]);
}
</script>
</head>
<body>
<input type ='button' value='Get First Day' onclick = 'getFirstDay(1,0,2013)' />
</body>
</html>

From the html code i called a function getFirstDay( ) with parameters date, month, year

The first step is to create a dateobject and make calls to the library functions

The functions setFullYear, setMonth, setDate sets the date, month, year we are passing into it.

Two arrays, day_names and month_names are declared to hold the week day names and month names

It’s obvious that the every month starts with a date 1.

So, the setDate(1) sets the date ‘1’.

getDay() returns the day

Read Full Post »