to open a page in new tab using self.location?
I am using self.location="www.google.com";开发者_运维知识库
in my code to open google page. How can i open same page in another window.
You can use the window object's open method like so:
window.open("www.google.com");
You can use an <a>
tag and set the target="_blank"
property to open a page in anew tab/window. Whether this will be opened in a new tab/windows depends entirely on the settings in the user agent.
<a href="http://www.google.com" target="_blank">Google</a>
try this
window.open ("www.google.com","mywindow");
<script>
function fullwin(targeturl) {
window.open(targeturl,"","fullscreen,scrollbars")
}
</script>
<form>
<input type="button" onClick="fullwin('mypage.html')" value="Show My Frameset">
</form>
i see at least one freaky method:
<a id='newwnd' href='goole.com' style='display:hidden' target='blank'></a>
...
document.getElementById('newwnd').click();
精彩评论