lundi 24 mars 2014

prevent opening another the same tab in browser


Vote count:

0




Let's say I have main.php and page1.html on my www apache server. Part of main.php:



...
<script>
function openNewTab(){
var win=window.open('page1.html', '_blank');
win.focus();
};
</script>
...
<?php
echo "<p><a href='' onclick='openNewTab(); return false;'>start</a></p>";
?>


When I click link above, I have opened two tabs: main.php and page1.html. And my aim is to prevent user opening another tab with page1.html, when he press link on main.php. Or , when user click link on main.php, tab with page1.html should be refreshed, but new tab shouldn't be opened.


thanks in advance.



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire