0

I have an ajaxcall which returns an html page to me in the response. I want to open this in a new window. How to make this work?

Image

console.log(data) basically prints the entire html content as if it were a single string

anwesh mohapatra
  • 903
  • 4
  • 11
  • 19

1 Answers1

0

This should work:

var tab = window.open('about:blank', '_blank');
tab.document.write(data); 
tab.document.close();

Source: https://stackoverflow.com/a/49019549/12968095

jamaglian
  • 9
  • 2