0
我想在另一個窗口打開彈出窗口。如何在彈出窗口中打開彈出窗口?
請檢查代碼 -
myjavascript.js
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
的index.html
<script src="myjavascript.js"></script>
<a href="#" onclick="NewWindow('popup1.html','name','500','500','yes');return false" class="link-2">My Account</a>
popup1.html
<script src="myjavascript.js"></script>
<a href="#" onclick="NewWindow('popup2.html','name','500','500','yes');return false" class="link-2">Click to open popup2</a>
popup2.html
<h1>You are now popup2.html page</h1>
上面的代碼是爲我工作,但第二彈出無法打開。請檢查並讓我知道。
感謝 @chatfun
功能是否有請在我的JavaScript中添加'NewWindow()'' – Developer 2014-10-09 10:28:31
我沒有提到,但'js'文件已經有'' – Developer 2014-10-09 10:30:46
是的我知道,我在說你在'index.html'中包含了這個函數,但不包含在'popup1.html'中。 – albciff 2014-10-09 10:31:09