Skip to content

Instantly share code, notes, and snippets.

@arantius
Created November 20, 2015 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arantius/e5b0bbff7ba341f06b6a to your computer and use it in GitHub Desktop.
Save arantius/e5b0bbff7ba341f06b6a to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Tab Open/Close order test</title>
</head>
<body>
<script>
if (location.search) {
document.title = 'Sub tab: ' + location.search;
}
</script>
<p>
Plain:
<a href='?A'>A</a>
<a href='?B'>B</a>
<a href='?C'>C</a>
<a href='?D'>D</a>
</p>
<hr>
<p>
Target _blank:
<a target='_blank' href='?A'>A</a>
<a target='_blank' href='?B'>B</a>
<a target='_blank' href='?C'>C</a>
<a target='_blank' href='?D'>D</a>
</p>
<hr>
<p>
window.open() on click:
<a onclick='window.open(this.href); return false;' href='?A'>A</a>
<a onclick='window.open(this.href); return false;' href='?B'>B</a>
<a onclick='window.open(this.href); return false;' href='?C'>C</a>
<a onclick='window.open(this.href); return false;' href='?D'>D</a>
</p>
<hr>
<p>
window.open by script:
<button onclick='window.open("?A");window.open("?B");window.open("?C");window.open("?D");'>Open x4</button>
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment