<tfoot id='FZAmP'></tfoot>
    <i id='FZAmP'><tr id='FZAmP'><dt id='FZAmP'><q id='FZAmP'><span id='FZAmP'><b id='FZAmP'><form id='FZAmP'><ins id='FZAmP'></ins><ul id='FZAmP'></ul><sub id='FZAmP'></sub></form><legend id='FZAmP'></legend><bdo id='FZAmP'><pre id='FZAmP'><center id='FZAmP'></center></pre></bdo></b><th id='FZAmP'></th></span></q></dt></tr></i><div id='FZAmP'><tfoot id='FZAmP'></tfoot><dl id='FZAmP'><fieldset id='FZAmP'></fieldset></dl></div>
      <legend id='FZAmP'><style id='FZAmP'><dir id='FZAmP'><q id='FZAmP'></q></dir></style></legend>
        <bdo id='FZAmP'></bdo><ul id='FZAmP'></ul>

    1. <small id='FZAmP'></small><noframes id='FZAmP'>

    2. 强制“另存为"通过 jQuery GET 对话框

      Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
        <tfoot id='qOsdW'></tfoot>

          1. <small id='qOsdW'></small><noframes id='qOsdW'>

              <bdo id='qOsdW'></bdo><ul id='qOsdW'></ul>
              <legend id='qOsdW'><style id='qOsdW'><dir id='qOsdW'><q id='qOsdW'></q></dir></style></legend>

                <tbody id='qOsdW'></tbody>
            • <i id='qOsdW'><tr id='qOsdW'><dt id='qOsdW'><q id='qOsdW'><span id='qOsdW'><b id='qOsdW'><form id='qOsdW'><ins id='qOsdW'></ins><ul id='qOsdW'></ul><sub id='qOsdW'></sub></form><legend id='qOsdW'></legend><bdo id='qOsdW'><pre id='qOsdW'><center id='qOsdW'></center></pre></bdo></b><th id='qOsdW'></th></span></q></dt></tr></i><div id='qOsdW'><tfoot id='qOsdW'></tfoot><dl id='qOsdW'><fieldset id='qOsdW'></fieldset></dl></div>
                本文介绍了强制“另存为"通过 jQuery GET 对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在对下面的 test.php 文件代码调用 jQueryGET".

                I'm calling a jQuery "GET" on the test.php file code below.

                我试图让脚本在生成的 test.ini 文件上弹出另存为"对话框,以允许将其保存在本地.但是,虽然我可以很好地将结果回显到 jQuery,但我似乎无法弹出另存为"对话框.

                I'm trying to get the script to pop a "Save As" dialog on the resulting test.ini file to allow it to be saved locally. However, although I can echo the result back to the jQuery fine, I can't seem to pop the "save as" dialog.

                更新:感谢以下解决方案,我刚刚将 $.get 更改为 window.location.replace.

                Update: Thanks to the solutions below, I just changed my $.get to a 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");
                
                    }
                );
                

                推荐答案

                您无法获得显示另存为"对话框的 ajax 请求,但您可以做的是在页面中插入一个隐藏的 iframe 元素,然后将该 iframe 的源设置为您希望用户下载的 url.瞧,这是您的另存为.

                You can't get an ajax request to show a "Save As" dialog, but what you CAN do is insert a hidden iframe element in the page, then set the source of that iframe to the url you want the user to download. Voila, there's your Save As.

                这是一个复制和粘贴示例:

                Here's a copy and paste example:

                $('a#linky').click(function(){
                  var iframe = document.createElement("iframe"); 
                  iframe.src = 'http://example.com/branding.zip'; 
                  iframe.style.display = "none"; 
                  document.body.appendChild(iframe);
                  return false;
                });
                

                这篇关于强制“另存为"通过 jQuery GET 对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <tbody id='rEJR1'></tbody>
              • <tfoot id='rEJR1'></tfoot>
                <legend id='rEJR1'><style id='rEJR1'><dir id='rEJR1'><q id='rEJR1'></q></dir></style></legend>

                  • <bdo id='rEJR1'></bdo><ul id='rEJR1'></ul>

                    <i id='rEJR1'><tr id='rEJR1'><dt id='rEJR1'><q id='rEJR1'><span id='rEJR1'><b id='rEJR1'><form id='rEJR1'><ins id='rEJR1'></ins><ul id='rEJR1'></ul><sub id='rEJR1'></sub></form><legend id='rEJR1'></legend><bdo id='rEJR1'><pre id='rEJR1'><center id='rEJR1'></center></pre></bdo></b><th id='rEJR1'></th></span></q></dt></tr></i><div id='rEJR1'><tfoot id='rEJR1'></tfoot><dl id='rEJR1'><fieldset id='rEJR1'></fieldset></dl></div>

                        1. <small id='rEJR1'></small><noframes id='rEJR1'>