Showing posts with label Html. Show all posts
Showing posts with label Html. Show all posts

Wednesday, January 5, 2011

Add/ Remove rows using javascript or Jquery

Jquery is one of the great and coolest feature in the web. you can desing your application any thing as u want with asynchronous call.
here i have created one small application for adding or removing the rows from your tables.

many times we are not sure how much length of user input is for ex. in case of
address field we are not sure how much length of data is so that time this coolest add/remove rows function will use.
just try it .

here is the basic java script.


<html>
<head>
<title> Add/Remove Rows in Table </title>
<script language="javascript">
function addRow(tableID) {

var table = document.getElementById(tableID);

var rowCount = table.rows.length;
var row = table.insertRow(rowCount);

var cell1 = row.insertCell(0);
var element1 = document.createElement("input");
element1.type = "checkbox";
cell1.appendChild(element1);

var cell2 = row.insertCell(1);
cell2.innerHTML = rowCount + 1;

var cell3 = row.insertCell(2);
var element2 = document.createElement("input");
element2.type = "text";
cell3.appendChild(element2);
}

function deleteRow(tableID) {
try {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;

for(var i=0; i<rowCount; i++) {
var row = table.rows[i];
var chkbox = row.cells[0].childNodes[0];
if(null != chkbox && true == chkbox.checked) {
table.deleteRow(i);
rowCount--;
i--;
}

}
}catch(e) {
alert(e);
}
}
function SubmitForm()
{
// your form Validation code goes here ...
}

</SCRIPT>
</head>
<body>
<TABLE id="dataTable" width="350px" border="1">
<TR>
<TH>Select</TH>
<TH>Sr. No.</TH>
<TH>Value</TH>
</TR>
<TR>
<TD><INPUT type="checkbox" name="chk"/></TD>
<TD> 1 </TD>
<TD> <INPUT type="text" /> </TD>
</TR>
</TABLE>
<INPUT type="button" value="Add Row" onclick="addRow('dataTable')" />
<INPUT type="button" value="Delete Row" onclick="deleteRow('dataTable')" />
<INPUT type="button" value="submit" onclick="SubmitForm()" />
</BODY>
</HTML>



hope u like it .,.... just commnet it.. the jquery example i will post it on my next post.

Tuesday, December 22, 2009

ways to Speed Up your Page Response Times.

Its ok with if we develop any web application, but it you speed up your application in right manner then you will be a charm of web. users requirement is they want to see your application page as quickly as , but if your application is time consuming from all the aspect then surely no one will stay on with your site. here i got some nice and simple techniques which will improve your page speed from all the aspect. now google also setting this as a basic criteria.

Now you all knows mozilla has some good addon call "Firebug" you can install that plus you can also install ""Google page Speed " which will tell hows your application is behave . there is one more useful addon by yahoo is "YSlow" .



from this addons you will get lot of information , also try this
1. Load your CSS first and your JavaScript last
Load your css in <head > tag above your body . and try to load your javascript above the closing the body tag.

2. Using Sub domains for parallel downloads
This is like cool one , on your site that are lot many static and dynamic images , you can identify that what are the static and what are the dynamic and according to that you can set your sub domain which will useful for parallel download ,so the time requires to download a single image will be get converted into parallel server and parallel image get download from your one of the server .The ideal case is you can set max of 3 server for same,

3. Minify JS and CSS:
Again size get matter , means one your page if you keep unwanted space on js & css surly size get increase, in this case you can reduce that and make them as lighter as possible, if you use above tools they will give you option how to inimize this or minimize version of same.

4. Avoid redirects:
No matter if you do a server-side header redirect, JS,HTML redirect, your site is going to load a header with a blank page, then load your new page, increasing the time it takes for a user to get to the actual page they want to go to

5. Using CSS Sprites to reduce HTTP Requests
CSS Sprites may be the coolest thing, it get reduce your page loads and also reduce the amount of request for each particular images. now look at below you can see one image (static one) contain 15 + images now using CSS you can cut that according to your requirement (using Padding and all )
and use that as you want.
Best example you can see is " YouTube CSS Sprite ".



define that like this way:


< style >
.sprite {
background:url(http://s.ytimg.com/yt/img/master-vfl87445.png);
}

#logo {
width:100px;
height:45px;
background-position:0 0;
}
</style >

<div id="logo" class="sprite"> </div>



That was a lot of stuff, but hopefully you picked up a few tips on how to make your web pages load faster. if you know more on this
add it on comments .

Thursday, December 17, 2009

Traversing an Html table with Javascript

This article will introduce you on how to get html table content using DOM Inteface, ones we create an Table on html and suppose we need to retive that table content on server side, on any purpose then this will helps you.you can refer this its really nice way to parse the html table and get the content on same .

mozilla developer has given a good link on ,how to create a DOm interface for table structure

sample example:
1. lets create a Table

<table>
<tbody>
<tr> <td> This is first td </td></tr>
<tr> <td> This is second td </td></tr>
<tr> <td> This is third td </td></tr>
</tbody>
</table>


2. now create a Dom inteface to read this table content , for that you can use Javascript to read this

<script >
function start() {
// get the reference for the body
var body = document.getElementsByTagName("body")[0];

// creates a <table> element and a <tbody> element
var tbl = document.createElement("table");
var tblBody = document.createElement("tbody");

// creating all cells
for (var j = 0; j < 2; j++) {
// creates a table row
var row = document.createElement("tr");

for (var i = 0; i < 2; i++) {
// Create a <td> element and a text node, make the text
// node the contents of the <td>, and put the <td> at
// the end of the table row
var cell = document.createElement("td");
var cellText = document.createTextNode("cell is row "+j+", column "+i);
cell.appendChild(cellText);
row.appendChild(cell);
}

// add the row to the end of the table body
tblBody.appendChild(row);
}

// put the <tbody> in the <table>
tbl.appendChild(tblBody);
// appends <table> into <body>
body.appendChild(tbl);
// sets the border attribute of tbl to 2;
tbl.setAttribute("border", "2");
}
</script >


3. This javascript will first read the table tag element and search with tbody and tr then next td and retrive the content on same .

4. Remember this technique. You will use it frequently in programming for the W3C DOM. First, you create elements from the top down; then you attach the children to the parents from the bottom up.

5. Its create just like this way .

Monday, November 2, 2009

15+ Firefox addons for Developer and Designers

Addon's playing important role for web developer as well as for web desginer also , you can say its make your task easier. Firefox is one of the free and open source web browser and provides most comman features for web devloper and designer,
There are huge no of lists of addons or extensions . here i have mention some of them which are really useful for a developer as well as for designer.

Firebug


Firebug is very commonly use addon , which can easily catch javascript , jquery error in live page , you can edit and also debug the live application using this cool addon


Web Developer


This addon very much useful for the again developer to test there live application in terms of html, css, dhtml , images and so on, ones you install this addon you can find that addon on new toolbar


FirePHP


its enable you to log to your Firebug console using php method call. its basically suit for the ajax development process.


ColorZilla


ColorZilla will get you the color which is reading from mouse pointer , you just need to move your mouse on that location and you will get the color of same , you can also zoom that page you also measure the distance between the any two points . you can also save that selected color as a custom palettes


CSSViewer


its a very common tool ones you hover on any element, it will display all CSS styles for that element.


Window Resizer


Resize your Browser to various size, basically its useful for testing the your application on various sceen , then you come to know you application is feet in current window or not , there are some resoultion : 64x480 , 800×600, 1024×768, 1280×800, 1280×1024, 1600×1200


Cooliris


its a cool addon , you can easily browse the photos and videos from web.


HTML Validator


displays the number of found errors of the site you are viewing. it will parse the html page and display the error.

URL Fixer


it corrents the typos in URL that enter in the address bar. for example if you type rediff.con instead if com it will automatically fix it and parse it and redirect to you on actaul site, Current version is support the .com,.net,.org.,.edu..gov,.mil and other TLD.


FEBE


FEBE (Firefox Environment Backup Extension) allow you to quickly and easily backup your firefox. it will rebuild your extensions into .xpi files.


LiveHTTPHeaders


its allows you to analyze your http header , it will also help you to debug you web applicaiton ,you can also see what sort of server is using and also view cookies sent by the remote sites,


StumbleUpon


stumbleUpon is a social bookmarking sites , its useful to you to search the sites , this site derive a large no of visitors to your sites.


Font Finder


font finder tools helps you to find the font of highlighted text, you need to just select the text and right click to see all the styling get included on that text you can also view the Color, font-family and so on

CSS Validator


Validate your page using W3c css validator. just right click on page and select Validate CSS it will validate and parse your page and open result on new tab and show you error on same.


Autofill Forms


auto fill is one of the best option or addon, instaed of typing text again and again you just save that text on AutoFill Form and whenever you required you simply use that so it will get fill that field automatically , for example on Gmail.com , you need to enter id & password to access your account now instad of typing id & password daily you just save . and ones you open gmail.com page click on AutoFill option . it will automatically get fill your id & password .


if u know more add in on a Comments .

Saturday, October 3, 2009

free online editors for your asp.net application

Editor is one of the requirement while taking the long input from the user , just like there
long long comments, about us , comments, and many more editor play important role in this case , you can edit that text as per you want you can use all html tags and all to make your reply or comments or text better.
here are the some free online editor you can integrate that on you .net web application.

1. widgEditor

widgEditor
Download widgEitor
Demo

2.markItUp

markItUp
Download martkUp!
Demo

3. Yahoo! UI Text Editor

Yahoo
Download Yahoo!UI Text Editor
Examples


4. NicEdit
NicEdit is a Lightweight, Cross Platform, Inline Content Editor
NicEdit
Download NicEdit
Demo

5. JWYSIWYG

JWYSIWYG
Download JWYSIWYG
Demo



free online editors for your asp.net application

Friday, October 2, 2009

Enhanced country selection with Css and Javascript

When we designing a Registration form , Country & state option are consider, in that time we prefer Drop down option to populate various state or country and user get select one of them , its a very old process , you can redevelop that using ajax, css ,javascript and so many other ways ,

here is very nice way to select Country using simple CSS and Javascript


as you can see , you need to move your mouse over the text box and various country with there flag drop down get populate and you can selete one of the country on same , and that country name will appear in that text box

Download source

hope you like it ,

Thursday, September 24, 2009

Data Grids with(AJAX,jvaScript, Dhtml)

DataGrids is one of the useful control to show data in tabular format with different different records & result, on gridView you can show as many as option which is very much useful for the end user, to handle with Data Grid and all ,

Here are some Data Grid Controls Devlope with ajax/dhtml/and javascript

1. ExtJs Grid


2. Phatfusion Sortable


3. Table Kit


4.Unobtrusive Table Sort Script.


5.Yahoo UI Library’s DataTables.


6.Standardista Table Sorting


7.Mootable Sorting.


hope u like this collection,
if you know more then plz add it on Comments ,

Monday, September 7, 2009

Add Feedburner Email subscription to your site

you have see most of the sites,blogs have there email subscription option on there site basically its useful for the out site reader to directly read our new feed . in this process there are so many third party site , tool are available to do that ,

"FeedBurner is one of them". if you want to add feedburenr account on your site do follow below steps to configure feed burner email subscription tp your site or blog.

Steps.
1. At first you need Feed burner account. if you dont have account with feedburner click here
if you have account with google then also ok, you can use that.

2.now next steps is if your new FeedBurner user then you have to burn your feed at first,

3.now you burned a feed to your site or blog.


4.now configure your site or blog to show fedburner url for that you have add some htmlcode in your back end,to retrieve this code you need to select publicize > Email Subscription


5.click on that link it , in that page you will get one form tag code simply copy that code and paste it on your site or blog.You can even select your blog type like (Typepad, wordpress, blogger) and it will automatically take to widget option for corresponding blogs system.

6.now u finish with the coding part , open that page and enter your email id and click subscribe , that it..

if you want to Subscribe my blog click here , you will get the updates of my blog via email
thank you.

Saturday, August 29, 2009

Color Tools For Web Designers

Color is very basic key in web development , to identifying exact color or color name is very tedious , so its better you can use the Color tools that can help you to find out the matching color or your required color palette.

here are some list of sites providing best color tools for web designer to make desing very atractive.

1-Colr.org


2-Color Wheels


3- Color Palette Generator


4-list of Web 2.0 Color Palette


5-Color Blender


6-ColorDB


7-Color Hunter

hope you like this tools
happy coloring ...

Thursday, July 16, 2009

CSS New look at CSS3

CSS3 is the new kid in the stylesheet family. It offers exciting new possibilities to create an impact with your designs, allows you to use more diverse style sheets for a variety of occasions and lots more. We created this site because we want to share our experiences of CSS3 with you...

Watch out Preview Preview

Check Is your browser compatible? Test Drive

Module status at Status