Stop a postback by javascript with IE7

Somehow the statement javascritpt:return false; doesnt work with IE 7. But there is a workaround by setting the event.returnValue to false.

OnClientClick="javascript:event.returnValue=false; return false;"

Minifying javascript source files.

I just want to recommend you a very simple tool called JSMin, which helps minifying the javascript sources. This code improvement significantly decreases the download time because of the smaller page size. The toll successfully removes whitespaces and comments which are not needed on client side.

The tool is available as a script or a console application.

The usage of jsmin.exe is simple:
jsmin.exe output.js

Javascript Query String

The query string is reachable through window.location.search property. Splitting it by & gives you list of passed GET parameters.


function GetPageParameter(param) {
var query ='';
if (window.location.search.length>3){
//removes '?' from the query string
query = window.location.search.substring(1);
}else{
return '';
}
params = query.split("&");
for (i=0;i1){
if (pair[0] == param) {
return pair[1];
}
}else{
return '';
}
}
return '';
}

var value = GetPageParameter("value");