Programming in almost language

This is the site where you may share your knowledge and experience to eachother..

  • Categories

  • LinkedIn

  • Tweet Me

  • My footsteps

Java script

Posted by Praveen Kumar on March 3, 2008

JavaScript Key Code

First try to get the key code whether its returning some code or not

alert(event.keyCode);

Press any key to determine the javascript key code of that key. This is a simple script:

<script language=”JavaScript”>
document.onkeydown = checkKeycode
function checkKeycode(e) {
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
alert(“keycode: ” + keycode);
}
</script>

Auto Refresh page after clicking on close/submit button

<a href=”javascript:window.opener.location.reload();javascript:window.close();”>

<input type=”button” value=”Close” />

</a>

this will close popup after clicking save button of popup and refresh the parent form.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

 
%d bloggers like this: