I have a page which shows some data from a database. Each of these data rows has a link with an ID.
<a href="javascript:void(0);" onClick="changeUrl(\'?side=annoncer&sletid='.$row['annonce_id'].'\');"> This is the changeUrl function:
function changeUrl(url) { window.history.replaceState(null, "Title", url); } The link points to the same page, with &sletid added. When &sletid is set, the page should do a popup with the ID of the selected row.
if (isset($_GET['sletid'])) { $sletid = $_GET['sletid']; echo "<script language='JavaScript'>alert ('ID:".$sletid."');</script>"; } The URL changes, and the popup script code is added to the source, but the popup doesn't show unless I manually update the page again. Why this behavior?
buttoninstead ofa, if it's really not a link at all