admin管理员组文章数量:1317909
so I'm getting an email's HTML response back from the server and in jQuery I'm trying to render that response into a popup window.
I tried this at first:
postToServerWithAjax('/invite_preview', null, function (response) {
window.open($(response), "popupWindow", "width=600,height=600,scrollbars=yes");
});
However that just opened up the Popup window with [object, object] in the URL. I tried .html() below
postToServerWithAjax('/invite_preview', null, function (response) {
window.open($(response).html(), "popupWindow", "width=600,height=600,scrollbars=yes");
});
^ And this just returned a blank popup window
I then tried just a blank page, but my code keeps placing the HTML into the url bar:
window.open(response).html();
What am I missing to actually render the HTML into the new popup/page?
Found some examples here, and used the answers, but haven't gotten the HTML to render yet :(
display html code of response returned by ajax, Jquery
jQuery function to open link in new window
so I'm getting an email's HTML response back from the server and in jQuery I'm trying to render that response into a popup window.
I tried this at first:
postToServerWithAjax('/invite_preview', null, function (response) {
window.open($(response), "popupWindow", "width=600,height=600,scrollbars=yes");
});
However that just opened up the Popup window with [object, object] in the URL. I tried .html() below
postToServerWithAjax('/invite_preview', null, function (response) {
window.open($(response).html(), "popupWindow", "width=600,height=600,scrollbars=yes");
});
^ And this just returned a blank popup window
I then tried just a blank page, but my code keeps placing the HTML into the url bar:
window.open(response).html();
What am I missing to actually render the HTML into the new popup/page?
Found some examples here, and used the answers, but haven't gotten the HTML to render yet :(
display html code of response returned by ajax, Jquery
jQuery function to open link in new window
Share Improve this question edited May 23, 2017 at 12:24 CommunityBot 11 silver badge asked Dec 3, 2013 at 19:44 Leon GabanLeon Gaban 39k122 gold badges349 silver badges550 bronze badges1 Answer
Reset to default 8The first parameter is a URL, not actual content, you have to write that to the window
postToServerWithAjax('/invite_preview', null, function (response) {
var wind = window.open("", "popupWindow", "width=600,height=600,scrollbars=yes");
wind.document.write(response);
});
本文标签: javascriptHow to render server response as HTML into a popup window jQueryStack Overflow
版权声明:本文标题:javascript - How to render server response as HTML into a popup window? jQuery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742027441a2415810.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论