Reputation: 153
I'm trying to make a page refresh, when user clicks an image.
I tried something like this:
<a href="no_serie.php"><img style="max-width:150px; margin-top: 1px;"
src="bootstrap/img/ICOMS-LOGO.jpg">
</a>
But this doesn't work. When I click on the picture, nothing happens.
Am I doing something wrong?
Full Code:
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a href="no_serie.php">
<img style="max-width:300px; margin-top: 1px;" src="bootstrap/img/ICOMS-LOGO.jpg">
</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="ajouter_produit.php">Ajouter un Produit</a></li>
<li><a href="ajouter_lot.php">Ajouter un Lot</a></li>
<li><a href="ajouter_distributeur.php">Ajouter un Distributeur</a></li>
<li><a href="ajouter_employe.php">Ajouter un Employé</a></li>
</ul>
</div>
</div>
</div>
Upvotes: 0
Views: 1609
Reputation: 803
Just remove the link in the href in your anchor tag and add a javascript to it.
And your done. Please check the code below.
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a onclick="location.reload();" href="javascript:;">
<img style="max-width:300px; margin-top: 1px;" src="bootstrap/img/ICOMS-LOGO.jpg">
</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="ajouter_produit.php">Ajouter un Produit</a></li>
<li><a href="ajouter_lot.php">Ajouter un Lot</a></li>
<li><a href="ajouter_distributeur.php">Ajouter un Distributeur</a></li>
<li><a href="ajouter_employe.php">Ajouter un Employé</a></li>
</ul>
</div>
</div>
</div>
Upvotes: 0
Reputation: 11
Try to replace your anchor tag with the following piece of code:
<a href="javascript:history.go(0)">
<img style="max-width:150px; margin-top: 1px;" src="bootstrap/img/ICOMS-LOGO.jpg"/>
</a>
Upvotes: 0
Reputation: 3974
There is nothing wrong in the code. It works perfectly. Try to use another browser if possible.
Try to disable some extensions if you have some. Some browser might detect that you are on the same page name and will not reload it.
Upvotes: 0