rihaszou
11-24-2008, 04:41 PM
I have a function and the purpose of the function is to get two variables, pc1 and pc2. They are both getting their data from the same text box. pc1 should get the data when the page is onload, and pc2 should get it when the page is onbeforeunload. I have them in the same function so I can compare them, see if anything has changed, and then ask the user if they want to save. The problem I am having is distinguishing between which event the function has fired for:
window.onload = func();
windown.onbeforeunload = func();
function func()
{
if (//some code needed here to see if its onload)
var pc1 = textbox info
if (//some code needed here to see if its onbeforeunload)
var pc2 = textbox info
if (pc1 ==pc2)
(do something)
}
any help would be appreciated...
}
window.onload = func();
windown.onbeforeunload = func();
function func()
{
if (//some code needed here to see if its onload)
var pc1 = textbox info
if (//some code needed here to see if its onbeforeunload)
var pc2 = textbox info
if (pc1 ==pc2)
(do something)
}
any help would be appreciated...
}