我在下面的 test.php 文件代码中调用 jQuery“GET”。
我试图让脚本在生成的 test.ini 文件上弹出一个“另存为”对话框,以允许将其保存在本地。然而,虽然我可以将结果回显给 jQuery,但我似乎无法弹出“另存为”对话框。
更新:感谢以下解决方案,我刚刚将 $.get 更改为 window.location.replace。
$('#test').click(
function()
{
//$.get('<?php echo get_bloginfo('template_directory') ?>/test.php');
window.location.replace("<?php echo get_bloginfo('template_directory') ?>/test.php");
}
);