Tuesday, December 28, 2010

Google Chrome allows you to open a new link in a separate process

Google Chrome allows you to open a new link in a separate process!

Google Chrome developers have pointed to an interesting tip from their database.

You can code a link to open in a new tab that runs in a separate process!

The basic idea is to open the link without passing on the referring information.

Google Chrome developers had this to say:

The easiest approach is to use a link to a different web site that targets a new window without passing on referrer information. Google Chrome recognizes this as a hint to keep the new page isolated from the original page, and it will load the new page in a separate process.

For example:
 <a href="http://utopianimages.blogspot.com" target="_blank" rel="noreferrer"> My Another Blog </a> 


For example: My Another Blog

Friday, November 19, 2010

Dynamic xml Parsing using java script

Saturday, September 11, 2010

DataBase Connection Class

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
* Description of conCls
*
*/
class conCls {
//put your code here
var $con = null;
function connectDB()
{
$this->con = mysql_connect('localhost', 'root', '') or die('MySQL Connectivity Error..!
Error No : '. mysql_errno(). '
Error : '. mysql_error());
mysql_select_db('dcwb', $this->con);
return $this->con;
}

function Query($query)
{
$result = mysql_query($query, $this->con) or die('MySQL Query Error..!
Query : ' . $query . '
Error No : ' . mysql_errno() . '
Error : ' . mysql_error());
return $result;
}
function closeDB()
{
mysql_close($this->con);
}
}

Validation

Name Validator
=============
"input type="text" name="city_name" id="city_name" title="City Name" class="txtbox" onkeypress="return valPersonName(event);" onblur="Trim_Spaces(this.id);"
=============
function valPersonName(evt)
{
var charCode;
charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90 || charCode==32 || charCode==46 || charCode==8)
{
return true ;
}
else
{
return false;
}
}
PhoneValidator
=============
"input name="txtPhoneNo" type="text" id="txtPhoneNo" title="Phone No." class="txtbox" onkeypress="return valPhone(event);" onblur="Trim_Spaces(this.id);"
===========
function valPhone(evt)
{
var charCode;
charCode = (evt.which) ? evt.which : event.keyCode;getAttention
if (charCode == 40 || charCode == 41 || charCode == 43 || charCode == 44 || charCode == 45 || charCode >= 48 && charCode <= 57 || charCode == 32 || charCode==8)
{
return true;
}
else
{
return false ;
}
}
====================================
Address and Long string like Interest and all
====================================
"textarea name="txtmessage" id="txtmessage" cols="29" rows="4" class="txtbox" style="height: 50px;" title="Message" onkeypress="return valSpecialset(event);" onblur="Trim_Spaces(this.id);"
"/textarea"
==================================

function valSpecialset(evt)
{
var charCode;
charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90 || charCode >= 48 && charCode <= 57 || charCode==32 || charCode==36 || charCode==33 || charCode==42 || charCode==35 || charCode==64 || charCode==46 || charCode==8)
{
return true ;
}
else
{
return false ;
}
}
====================================
Email Validation
====================================

if(document.getElementById('txtEmailAddress').value!='')
{
var id = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var address = document.getElementById('txtEmailAddress').value;
if(id.test(address) == false)
{
alert('Invalid Email Address');
document.getElementById('txtEmailAddress').focus();
return false;
}
}