Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
18
rated 0 times [  20] [ 2]  / answers: 1 / hits: 5879  / 11 Years ago, tue, december 3, 2013, 12:00:00

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();


enter



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


More From » jquery

 Answers
4

The 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);
});

[#49880] Monday, December 2, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lucianom

Total Points: 601
Total Questions: 98
Total Answers: 109

Location: Kenya
Member since Fri, Dec 23, 2022
1 Year ago
lucianom questions
Tue, Feb 22, 22, 00:00, 2 Years ago
Wed, May 5, 21, 00:00, 3 Years ago
Sun, Jan 24, 21, 00:00, 3 Years ago
Sat, Aug 15, 20, 00:00, 4 Years ago
Mon, Jun 22, 20, 00:00, 4 Years ago
;