Dev Kurd Dev Kurd - 10 days ago 6
Javascript Question

show image change URL without reload the page

how i can click image , open image with out reloading with by php and javascript?

<?php
echo '<li>
<a href="photo.php?id='.$id.'">
<div class="_th_alb">
<img src="image/'.$allbum_photos.'" >
</div></a>
</li>';
?>


with like image

Answer

What you want is called a modal.

You can see some examples right here: http://www.w3schools.com/howto/howto_css_modal_images.asp

To the modifying URL part:

You can use

window.history.pushState('a string or object', 'Title', '?image=as1234da3sdasd');

Hope this helps