2011-07-15 46 views
0

我不確定這是否可行,但我正在嘗試獲取下面的HTML頁面(具有Frameset/Frames)來調整大小(寬度和高度),刪除菜單欄,工具欄&滾動條通過JavaScript加載。我一直通過堆棧和谷歌無濟於事。使用JavaScript修改當前窗口

這是爲AICC課程,所以不幸的是它是適當的,我使用框架/框架。

frameset.htm - 原來這裏是HTML頁面:

<html> 
<head> 
<title>Page Title</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
</head> 
<frameset frameborder="0" border="0" framespacing="0" rows="*,1"> 
    <frame src="course.htm" scrolling="0" frameborder="0"> 
    <frame src="results.htm" scrolling="0" frameborder="0"> 
    <noframes> 
    <body> 
     <p>This web page uses frames, but your browser doesn't support them.</p> 
    </body> 
    </noframes> 
</frameset> 
</html> 

frameset.htm - 這是我想創造,我認爲可以工作的代碼,但我想我失去了一些東西:

<html> 
<head> 
<title>Page Title</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
<script language="JavaScript" type="text/JavaScript"> 
function courseLauncher(theURL,winName,features) { 
    window.open('','_self',''); 
    window.open(theURL,winName,features); 
    this.focus(); 
} 
</script> 
</head> 
<frameset frameborder="0" border="0" framespacing="0" rows="*,1" onLoad="courseLauncher('frameset.htm','course','width=1000,height=700');"> 
    <frame src="course.htm" scrolling="0" frameborder="0"> 
    <frame src="results.htm" scrolling="0" frameborder="0"> 
    <noframes> 
    <body> 
     <p>This web page uses frames, but your browser doesn't support them.</p> 
    </body> 
    </noframes> 
</frameset> 
</html> 
+0

@Mimisbrunnr - 如何控制瀏覽器窗口大小,菜單欄,工具欄和滾動條利用CSS? – leegraham

+0

啊,對不起,我誤解了。 – zellio

+0

任何人有任何建議? – leegraham

回答

0

下面的代碼打開一個窗口,沒有菜單欄,滾動條和工具欄。

window.open ("","mywindow","menubar=0,scrollbars=0,toolbar=0, width=350,height=250"); 

所以,

courseLauncher('frameset.htm','course','menubar=0,scrollbars=0,toolbar=0,width=1000,height=700') 

還解決您的courseLauncher功能

function courseLauncher(theURL,winName,features) { 
    var win = window.open(theURL,winName,features); 
    win.focus(); 
} 
相關問題