I am trying to open a debug window in Javascript. Javascript passes the debug window to the JSON string, which the JSONView (Chrome extension) should display in a conveniently formatted format.
For this, the MIME type must be " application/json
". Is it possible to send the mime type and JSON string to window.open
as a parameter in some way? I think the MIME type and content should be set to window.open, otherwise the JSONView will not start.
I tried this, but this did not work:
var x = window.open("about:blank", 'x'); var doc = x.document; doc.open("application/json"); doc.write($(".trend_chart").attr("data-trendChart"))
source share