Jump to content

Recommended Posts

yes it can be done, try this functions

function loadsite(e) 
{
	if (!e) e = window.event;
	if (e.keyCode) 
	{
		if (e.keyCode == "27")
                {
                    setTimeout('openurl()',10000);
                }
	}	
}

function openurl()
{
        window.location.href = 'SITE_URL';
}

first function is to check key code and if key is ESC key, then after some time interval(10000 = 10 seconds) it will call openurl() function, which is given next function

 

now write below given code at the end of the page, it will check the key event and will call the loadsite() function

document.onkeydown = loadsite;	

also you can check setTimout function reference here

http://www.w3schools.com/jsref/met_win_settimeout.asp

 

 

may this will help you

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.