2

i'm doing and Ajax call to send parameters to one .php file, when the call is done, i want to popup a new window to the results page, but it doesn't work.

here is my ajax code

        $.ajax({
            type: "POST",
            url: "pipeline2.php",
            data: formData,
            cache: false,
            processData: false,
            contentType: false,
            //async: false,
        }).done(function (data) {
            $("#resultados_pipeline").append(data);
            document.getElementById('Running').style.display = 'none';
            window.open("results_page.php?jid="+job_id);
            alert(job_id);
        });

i first think that maybe the job_id is not set in ajax, but the alert show me the expected...

i also tried with the async: true, and it doesn't work either

4

1 回答 1

2

浏览器不允许window.open调用,除非涉及到用户触发的事件。

Ajax 响应事件不是由用户触发的,因此此时会阻止弹出窗口。

于 2012-12-19T17:21:38.007 回答