I have a script like this:
<script type="text/javascript">
function DeletePublisher(publisherid) {
jConfirm('Are you sure you want to delete this publisher?', 'Delete publisher', function(r) { if (r)
scriptitem = document.createElement('script');
scriptitem.type = 'text/javascript';
scriptitem.src = 'includes/publishers/delete-publisher.php?publisherid=' + publisherid;
scriptitem.id = 'ajax';
document.body.appendChild(scriptitem);
setTimeout('document.body.removeChild(document.getElementById("ajax"))', 500);
$.jGrowl('Publisher deleted');
window.location.reload();
});
}
</script>
And I am listing rows in table like this:
TD ROWS HERE...
<td class="unpaid-th"><strong><?php echo $publisher_unpaid; ?></strong></td>
<td class="action-th">
<ul class="button-table-head">
<li><div class="button-head edit-icon"><a href="#" class="sweet-tooltip" data-text-tooltip="Edit" data-style-tooltip="tooltip-mini-slick"><span>Edit</span></a></div></li>
<li><div class="button-head delete-icon"><a href="#" class="sweet-tooltip" data-text-tooltip="Delete" data-style-tooltip="tooltip-mini-slick" onclick="DeletePublisher('<?php echo $publisher_id; ?>')"><span>Delete</span></a></div></li>
</ul>
</td>
Now what should happen is when I click on delete link - it should post/get (whatever - as i use $_REQUEST on listener script) to php script that will get the id of publisher and delete it from DB.... But the problem seems to be that no ID is actually send to delete script and I've tried everything....
It displays nice in source code like onclick="DeletePublisher('152')" and prompts alerts, infos etc... but it seems that it's not sending ID..... OR NOW MAYBE NOT EVEN CALLING A LISTENER script (don't know how to test it) :(
Any ideas what's wrong here (or maybe different approach?) ?
Thanks a lot !