This is a simple example to open link in new page or tab using java Script. The first example is default, just opens a new page for given link while the second example have custom settings.
Open new window with default settings:
<html>
<head>
<script language=javascript>
function openwindow()
{ window.open("http://www.SharePointBank.com") }
</script>
</head>
<body>
<form>
<input type=button value="Open Window" onclick="openwindow()">
</form>
</body>
</html>
Open new window with custom settings:
This example demonstrate that how to open link in new window with customized settings. You can give the name of window – > my_new_window
toolbar-> specify if you need browser toolbar
width and Height , resizable, menu bar, scrollbar etc.
<html>
<head>
<script type="text/javascript">
function openwindow()
{
window.open("http://www.SharePointBank.com","my_new_window","toolbar=yes, location=yes, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400")
}
</script>
</head>
<body>
<form>
<input type="button" value="Open Window" onclick="openwindow()">
</form>
</body>
</html>
0 comments:
Post a Comment