, , -, -, . , - - (, Facebook), - , , .
window.open, location.href :
HTML:
<a href="/?something" target="mytarget">Open a link in new window</a>
<a href="/?anotherthing" target="mytarget">Open a link in opened window</a>
JS:
var targetlinks = document.querySelectorAll('[target="mytarget"]');
var opentarget = function(e){
if( "mytarget" in window ){
mytarget.location.href = e.target.href;
}
else {
window.mytarget = window.open( e.target.href, 'mytarget' );
}
e.preventDefault();
};
[].slice.call( targetlinks ).forEach( function(link){
link.addEventListener('click', opentarget );
});
( jsfiddle, probaly - , -).