Ajax post opens new window with about:blank url
<p>I have this Ajax post method which opens new window with data fine, but in URL field of a new window always stands about:blank. I want specific url to be written in url field.</p>

<pre><code>    if (url) {
        $.ajax({
            type: "POST",
            url: url,
            data: array
        }).done(function (data) {
            var w = window.open();
            w.location.href = url;
            w.document.write(data);
            w.document.close();
        });

        e.preventDefault();
    }
</code></pre>