Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1810
How to set a node's image through javascript.
posted

I'm working with WebDataTree clientside and need to set a node's image through javascript and cannot find how.

Any ideas?

 

Thanks in advance.

  • 33839
    Suggested Answer
    posted

    Hi rickycl,

    As far as I can tell, this is not possible from JavaScript.  You could get access to the image DOM element and change its source, but you would need to save off the new source somewhere and be sure to update the url on the server at some point.  If you have a node JS object, you can get the element using get_element().  Then use childNodes array to find the image.  It is probably the last image (any connector line images or spacer images will be first).

    regards,

    David Young