I would like to use the code below but want it to happen to the current page when I click the link. Is this possible? Thanks in advance. :)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Open window to fullscreen without f11</title>
<script type="text/javascript">
function openWin(url){
var sw=screen.width;
var sh=screen.height;
newwin=window.open(url,'newwin','width='+sw+',height='+sh+',top=0,left=0,scrolling=0,toolbar=0,direc tories=0,menubar=0,location=0');
}
</s开发者_运维技巧cript>
</head>
<body>
<a href="http://www.codingforums.com" onclick="openWin(this.href);return false;">Coding Forums</a>
</body>
</html>
Have you tried using window.location.href instead of window.open? window.open is used to open new browser window.
No it is NOT possible to open a url and CHANGE THE CHROME in the same window and you should not try either.
There is a horrific hack which opens a new window and closes the parent, but that is even worse.
There USED to be a fullscreen parameter but it was luckily removed. It is not up to the web "designer" to decide the size of the user's window nor to try and remove their history by closing the main window.
If you search for fullscreen here, you will get many, among this one:
How to make the window full screen with Javascript (stretching all over the screen)
精彩评论