N
newspost2000
Hi...
I was just reviewing some javascript pop up window functions on my
website and I descovered something... that I set the exact same
variable name twice for both functions... which is bookWindow. I
tested this for pages that use both functions and both types of pop
windows work no problem. Is there a problem in that I use the same
variable name twice? Is this considered bad form? Or maybe it makes
not difference at all because the variable only gets used when it is
called upon and then it leave memory.
All help and insite is appreciated.
<script language="JavaScript" type="text/javascript">
<!--
function newWindow(webpage) {
bookWindow = window.open(webpage, "newWin",
"menubar,status,scrollbars,resizable,toolbar,location,height=400,width=500,top=26,left=280")
bookWindow.focus()
}
function msiWindow(webpage) {
bookWindow = window.open(webpage, "msiWin",
"menubar,status,scrollbars,resizable,toolbar,location,height=600,width=754,top=0,left=0")
bookWindow.focus()
}
// -->
I was just reviewing some javascript pop up window functions on my
website and I descovered something... that I set the exact same
variable name twice for both functions... which is bookWindow. I
tested this for pages that use both functions and both types of pop
windows work no problem. Is there a problem in that I use the same
variable name twice? Is this considered bad form? Or maybe it makes
not difference at all because the variable only gets used when it is
called upon and then it leave memory.
All help and insite is appreciated.
<script language="JavaScript" type="text/javascript">
<!--
function newWindow(webpage) {
bookWindow = window.open(webpage, "newWin",
"menubar,status,scrollbars,resizable,toolbar,location,height=400,width=500,top=26,left=280")
bookWindow.focus()
}
function msiWindow(webpage) {
bookWindow = window.open(webpage, "msiWin",
"menubar,status,scrollbars,resizable,toolbar,location,height=600,width=754,top=0,left=0")
bookWindow.focus()
}
// -->