Configure HTML/JavaScript

Sunday, May 23, 2010

opening a new divisin window in javascript and handling ajax operation

//generate the message window

function showWindow(varTotalTax,evt)
{

//var evt = (evt) ? evt : ((window.event) ? window.event : "")
if(evt)
{
var elem = (evt.target) ? evt.target : evt.srcElement
var id = elem.id;
var x = evt.clientX - 10;
var y = evt.clientY + document.body.scrollTop+4;
var divObj = document.getElementById("popupdiv");
divObj.style.display = "block";
divObj.style.position = "absolute";
divObj.style.left = x;
divObj.style.top = y;
if(varTotalTax !=0)
{
divObj.innerHTML = "

"+varTotalTax+"

"
}
else
{
divObj.innerHTML = "Notes not available
X "
}
}
}

// close the generated window
function divclose(name)
{
var divObj;
divObj= document.getElementById(name);
divObj.style.display = "none";
}

in reference to: Google (view on Google Sidewiki)

No comments:

Post a Comment