Uncategorized

How to Prevent Right Click of Mouse in Web Page Using JAVASCRIPT

Using below code, we can prevent majority of uses from right clicking over a page and choosing “View Source”, or right clicking over an image and saving it.

Some times there might be the requirement to disable the pop up menu on click of right button.

Programmers may need to disable right click to prevent user from saving the images on the page or viewing the source of the page.

function clickIE() {
    if (document.all) {
        return false
    }
}

function clickNS(e) {
    if (document.layers || (document.getElementById && !document.all)) {
        if (e.which == 2 || e.which == 3) {
            return false
        }
    }
}
if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = clickNS;
} else {
    document.onmouseup = clickNS;
    document.oncontextmenu = clickIE;
}
document.oncontextmenu = new Function("return false");
Uncategorized

How to Setup Simple Count Down Timer Using Javascript

A countdown timer is an accurate timer that can be used for a website or blog to display the count down to any special event, such as a birthday or anniversary.

Learn how to create simple count down timer using javascript. Below is the simple example to display timer in your html page.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
http://jquery-1.12.2.js
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style>
#txt {
  border:none;
  font-family:verdana;
  font-size:16pt;
  font-weight:bold;
  border-right-color:#FFFFFF
}
</style>


$(document).ready(function(){
	init();
})
var mins
var secs;

function cd() {
 	mins = 1 * m("1"); // change minutes here
 	secs = 0 + s(":01"); // change seconds here (always add an additional second to your total)
 	redo();
}

function m(obj) {
 	for(var i = 0; i 
</head>

<body>
<form name="cd">
<input id="txt" readonly="true" type="text" value="" border="0" name="disp">
</form>
</body>
</html>

Urvam Technologies provides our clients with professional web development services, performed by our experienced and knowledgeable web developers; and as web development company it is essential for us to keep our web developers up to date and in tune with the latest technology.