How to open the newly created image in a new tab?

前端 未结 4 1074
无人及你
无人及你 2020-12-05 17:47

Below code creates the image in the bottom of the same page. How to display that image into a new tab/window instead of displaying in the same page?

succes         


        
4条回答
  •  时光说笑
    2020-12-05 18:32

    something like:

    success: function (data) {
            var image = new Image();
            image.src = "data:image/jpg;base64," + data.d;
    
            var w = window.open("");
            w.document.write(image.outerHTML);
        }
    

提交回复
热议问题