我有一个使用jQuery重定向页面的脚本。我希望它重定向到标记<a href="delete.php?id=23"
中指定的链接。下面是我的代码,它将其重定向到固定的网址http://localhost/Project1/delete.php
<script>
jQuery.noConflict();
jQuery(document).ready(function(){
var site_url = 'http://localhost/Project1/delete.php';
jQuery('#Delete').confirmOn({
questionText: 'This action cannot be undone at a later time, are you sure?',
textYes: 'Yes, I\'m sure',
textNo: 'No, I\'m not sure'
},'click', function(e, confirmed) {
if(confirmed) window.location.href = site_url;
});
});
</script>
<a href="delete.php?id=23" id="Delete" title="Delete This">Delete Me</a>