Canopy javascript function cannot find element

61 views Asked by At

quite specific Canopy F# question.

I can get the url from a background image with this function with the console in chrome

document.getElementsByClassName('tws-article-images--preload ng-scope tws-article-images--image-small')[0].style.backgroundImage.slice(4, -1).replace(/['']/g, '');

When im trying to do the same with Canopy.

   let images = js "document.getElementsByClassName('tws-article-images--preload ng-scope tws-article-images--image-small')[0].style.backgroundImage.slice(4, -1).replace(/['']/g, '')" |> string

returns javascript Cannot read property 'style' of undefined

Any solutions out here :)?

0

There are 0 answers

Related Questions in F#