Showing posts with label Web Deployment. Show all posts
Showing posts with label Web Deployment. 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 .

Saturday, August 29, 2009

Visual Studio 2010 for Web Developer

New version of VS 2010 get announced with new features and new look for web devlopes. they are mostly focusing on Dynamic data, MVC arch. and other great feature of Silverlight and some more runtime functionality get added.

Overview of Visual Studio 2010 - wed Development
Here is the Key area:
- Source View
- Web Development
- Desing View
- DB Deployment

On the Source view they are ading Html Snippets and some more features of Jscripts Intellisense.
on Web Development process some more web.config Trasformation features and web1 -click features.
and on Desing view - improve the CSS2.1 Supoort and some advance features.
DB Deployment get handle the Packaging and Deploying the databse with your applications

- You can view the presentation at PDC on this Topics
http://channel9.msdn.com/pdc2008/TL48/ (77.32 mins)

- yes you can download the beta version of Vs2010 from here
http://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&displaylang=en

you can find more on Visual Studio, Visual Studio 2010 ,VS,VS 10,Web Application Projects,WAP,Web Deployment,MSDeploy

hope you like this .