When i’m tryng to click the button i’m ghetting an error : popup is not defined , i have no ideea what to do
<input href="#dialog" type='button' value='Open' onclick="popup(<?php echo $image['image_id']; ?>); return false;" />
<script type="text/javascript">
function popup(image_id){
$.ajax({
cache: false,
type: 'POST',
url: 'popup.php',
data: 'image_id=' + encodeURIComponent(image_id),
success: function(data) {
}
});
}
</script>
Are you using
hrefattribute of thisinputelement? If not then you don’t need that. Also I would suggest you to attach theclickhandler usingjQuery. But if your markup and server side code does not help then you can try this.