jQuery modal-dialog , buttons, 重定向到 link, 在 jquery/js 中传递 PH

jquery modal-dialog , buttons, redirecting to link, passing php variables in jquery/js

本文关键字:js PH jquery buttons modal-dialog 重定向 link jQuery      更新时间:2023-11-10
$("#modal_confirmation").dialog({
            autoOpen: false,
            bgiframe: true,
            resizable: true,
            width:500,
            modal: true,
            overlay: {
                backgroundColor: '#000',
                opacity: 0.5
            },
            buttons: {
                             'Delete': function() {
                            //HERE I HAVE TO PUT A LINK TO GO TO A URL*
                                   $(this).dialog('close');
                             },
                            'Cancel': function() {
                    $(this).dialog('close');
                }
            }
        });
  • 链接必须传递 php 变量。我尝试过类似的东西:"删除":

    函数(( {window.location = "delete_content?id=" $idC

还有

window.location = "delete_content?id=" <?php echo $idC;?>

 <a  class='btn_no_text btn ui-state-default ui-corner-all tooltip modal_confirmation_link'  title='Eliminar' href=''>
      <span class='ui-icon ui-icon-circle-close'></span>
     </a>   

当您单击该链接时,它会打开一个带有我上面显示的按钮的模型目录。因此,当您单击删除时,总结它应该转到一个如下所示的链接:

delete_content.php?id=SOME NUMBER.

我也尝试在html/php上使用href属性,但没有成功。

buttons: {
     'Delete': function() {
     **var linkToRedirect = document.getElementById('completeLink').value;
     window.location = linkToRedirect;**
     $(this).dialog('close');
},

并在表格上:

<input type='hidden' name='completeLink' id='completeLink' value='delete_content.php?&id=$idC' />