2011-07-15 49 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(); 
} 
相关问题