String.prototype.trim = function () {
return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");
};
//written by Douglas Crockford
Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts
JavaScript trim()
JavaScript delete confirmation
function confirmDelete(msg,loc)
{
if( confirm(msg) )
{
location.href = loc;
}
}
or
function confirmDelete(message)
{
return confirm(message);
}
{
if( confirm(msg) )
{
location.href = loc;
}
}
or
function confirmDelete(message)
{
return confirm(message);
}
Subscribe to:
Posts (Atom)