I have two HTML pages. In one of them, we have the JavaScript functions code. In the other one, we want to show the result of the function.
First HTML page:
<script type="text/javascript">
function penAcBoyut(adres, genislik, yukseklik)
{
var param = "width=" + genislik + "," + "height=" + yukseklik;
window.open(adres, "_blank", param);
}
function penAcBoyutTest()
{
penAcBoyut("buton2.html", 400, 300);
}
</script>
<button type="button" onclick="penAcBoyutTest()">Click me</button>
Second HTML page:
<script type="text/javascript">
var clicks = 0;
function penAcBoyutTest() {
clicks += 1;
document.getElementById("clicks").innerHTML = clicks;
};
</script>
<p>Clicks: <a id="clicks">0</a></p>
When you click the button on the first page, that open the new page. But the counter doesn't work, doesn't increase the clicks label.