I have a javascript which loads a popup using a string containing the HTML as below:
[code=html]
function openFrameless(){
if (beIE){
NFW = window.open(“”,”popFrameless”,s) //”fullscreen,”+
NFW.blur()
window.focus()
NFW.resizeTo(windowW,windowH)
NFW.moveTo(windowX,windowY)
var frameString=”<html>”+
“<head>”+
“<title>”+title+”</title>”+
“</head>”+
“<body topmargin=”0″ leftmargin=”0″ onbeforeunload=javascript:”CheckIt()”>”+
“”+
“</body>”+
“</html>”;
NFW.document.open();
NFW.document.write(frameString);
NFW.document.close();
} else {
NFW=window.open(urlPop,”popFrameless”,”scrollbars,”+s);
NFW.blur();
window.focus() ;
NFW.resizeTo(windowW,windowH);
NFW.moveTo(windowX,windowY);
}
NFW.focus();
}
However, I now want to add javascript to this popup so that before the window closes, a Yes-No box telling the user that they could lose their data. I’ve been trying to simply add the code within quotes in the code above, but I get an error on the page when I view it. Can someone please help me with this?
Chris