hapster
09-18-2003, 07:04 AM
Up front Javascript comprises less than 1% of my experience. All I use I’ve found thanks to those who donate.
I’ve found a script that I wish to use to open a full screen pop-up from a link. Despite having ‘instructions’ I can’t get it to work. I’ve tried contacting the author but have not been able to get a helpful response.
I’m hopping that someone can take a look and advise me what needs fixing.
I’ll paste below, as I found it, the script (with its instructions) and highlight the error "unterminated string literal". In trying to fix it I created multiple errors - so time for help if someone can.
Script purpose: open Full Screen pop-up and other boarderless sized windows
<head>
<script>
// set the popup window width and height
var windowW=214 // wide
var windowH=398 // high
// set the screen position
var windowX = 260 // from left
var windowY = 100 // from top
// set the url
var urlPop = "fs.html"
// set the title of the page
var title = "Full Screen Pop-Up"
// set this to true if the popup should close
// upon leaving the launching page; else, false
var autoclose = true
// ============================
// do not edit below this line
// ============================
s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false
function openFrameless(){
if (beIE){
NFW = window.open("","popFrameless","fullscreen,"+s)
NFW.blur()
window.focus()
NFW.resizeTo(windowW,windowH)
NFW.moveTo(windowX,windowY)
var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
"<frame name='bottom' src='about :blank' scrolling='no'>"+
"</frameset>"+
" // ERROR - unterminated string literal
<script language="JavaScript">
<!--
window.open = SymRealWinOpen;
//-->
</script>
</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()
if (autoclose){
window.onunload = function(){NFW.close()}
}
}
</script>
</head>
<body onload="var SymTmpWinOpen = window.open; window.open = SymWinOpen; // ERROR - SymWinOpen is not defined
top.window.focus(); window.open = SymTmpWinOpen;">
<a href="javascript<img src="images/smilies/redface.gif" border="0" alt="">penFrameless()">open FS</a>
</body>
// Making the Frameless Popup Center on the Screen
// Comment out the two lines as shown, and add the two shown below them.
// set the screen position where the popup should appear
//var windowX = 260 // from left
//var windowY = 100 // from top
var windowX = (screen.width/2)-(windowW/2);
var windowY = (screen.height/2)-(windowH/2);
I’ve found a script that I wish to use to open a full screen pop-up from a link. Despite having ‘instructions’ I can’t get it to work. I’ve tried contacting the author but have not been able to get a helpful response.
I’m hopping that someone can take a look and advise me what needs fixing.
I’ll paste below, as I found it, the script (with its instructions) and highlight the error "unterminated string literal". In trying to fix it I created multiple errors - so time for help if someone can.
Script purpose: open Full Screen pop-up and other boarderless sized windows
<head>
<script>
// set the popup window width and height
var windowW=214 // wide
var windowH=398 // high
// set the screen position
var windowX = 260 // from left
var windowY = 100 // from top
// set the url
var urlPop = "fs.html"
// set the title of the page
var title = "Full Screen Pop-Up"
// set this to true if the popup should close
// upon leaving the launching page; else, false
var autoclose = true
// ============================
// do not edit below this line
// ============================
s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false
function openFrameless(){
if (beIE){
NFW = window.open("","popFrameless","fullscreen,"+s)
NFW.blur()
window.focus()
NFW.resizeTo(windowW,windowH)
NFW.moveTo(windowX,windowY)
var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
"<frame name='bottom' src='about :blank' scrolling='no'>"+
"</frameset>"+
" // ERROR - unterminated string literal
<script language="JavaScript">
<!--
window.open = SymRealWinOpen;
//-->
</script>
</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()
if (autoclose){
window.onunload = function(){NFW.close()}
}
}
</script>
</head>
<body onload="var SymTmpWinOpen = window.open; window.open = SymWinOpen; // ERROR - SymWinOpen is not defined
top.window.focus(); window.open = SymTmpWinOpen;">
<a href="javascript<img src="images/smilies/redface.gif" border="0" alt="">penFrameless()">open FS</a>
</body>
// Making the Frameless Popup Center on the Screen
// Comment out the two lines as shown, and add the two shown below them.
// set the screen position where the popup should appear
//var windowX = 260 // from left
//var windowY = 100 // from top
var windowX = (screen.width/2)-(windowW/2);
var windowY = (screen.height/2)-(windowH/2);