165
Views
1
Comments
cannot read properties of null (reading 'document')
Question

Hi guru's

I'm using a part of JS in my reactive app to open an image in a new tab in Chrome instead of downloading it.

var attachment_newTab = window.open("");

attachment_newTab.document.write(

    "<iframe width='100%' height='100%' src='data:"+$parameters.MimeType+";base64, " +

    encodeURI($parameters.BinaryData) + "'></iframe>"

);


Now we get the error: cannot read properties of null (reading 'document')

Not sure why because in the past this was working?


2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Freek,

Refer to this solution post for your use case: https://stackoverflow.com/a/27798235/16601327

See this sample: RWA |Open Image in New Tab

Refer to the attached .oml file


I hope this helps you!


Kind regards,

Benjith Sam

RWA_Lab_OpenImg.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.