Some important technique in JavaScript

##Some simple JavaScript Technique

##Open Popup with sending a URl get value:

function ItemDetails(pName,id)
{ alert(id); + "?ID=" + id,"MyWindow","status = 1,height = 400,width = 550,resizable = 1,toolbar=1'")

//Open JS Popup from code behind

string str="";
str = str + "'PrintMap.aspx?id=" + id + "','PrintMe','height=520px,width=620px,scrollbars=1,resizable=yes,toolbar=yes')";

str = str + "";
ClientScript.RegisterStartupScript(this.GetType(), "onclick", str);

// below technique is not recommended

string tem;
tem = "Page2.aspx";
Response.Write("script'" + tem + "','_blank','scrollbars=yes,width=400,height=500,resizable=yes') script");

##Page redirection using JS:

//redirect to current page(Not reload)

##Close Popup and reflect chage to parrent page

function closePopup()
/* OR window.opener.document.location.href='myParentWindow.newpage'; */
//self.close ()

##Check is not number value in javascript

function CheckAge(source, arguments)
{ var myVal=arguments.Value;
if(isNaN(myVal) || myVal<19)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s