Código para abrir uma página em outra janela através de um botão ou clicando em um link.
<html>
<head>
<title>Editor HTML Online</title>
</head>
<body hola-ext-player="1">
<div style="text-align: left;">
<input name="marcio" type="button" onclick="mostra()"/>
</div>
<a href="javascript:abrir('http://www.globo.com');">Clique Aqui</a>
</body>
<script language="JavaScript">
function mostra() {
var vURL = "http://www.uol.com.br";
abrir(vURL);
}
function abrir(vURL) {
var width = 700;
var height = 400;
var top = (screen.height - height) / 2;
var left = (screen.width - width) / 2;
window.open(vURL,"janela", "width="+width+", height="+height+", top="+top+", left="+left+", scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=yes, fullscreen=no");
}
</script>
</html>
Nenhum comentário:
Postar um comentário