I am trying to use window.open in a javascript onclick function for a clickable embedded image. For some reason it is not working. I am trying to embed this into a Google Looker extension framework.
Edit: When I open the webpage on Looker Extension framework, nothing happens when the image is clicked. Ideally, I would like a page to be opened in a new tab when the image is clicked.
var img = new Image()
img.src =
'https://marketplace-api.looker.com/visualization-screenshots/report_table_icon.png'
img.onclick = function () {
window.open('https://looker.com/', '_blank')
}
document.body.appendChild(img)