javascriptdashcode

Set source for the image object - Dashcode related


How can one change the source of an image object in Dashcode (Javascript) at runtime?

I tried:

var image = document.getElementById("image").object; image.src = "IMG_0230.JPG";


Solution

  • I have an image in a list view and I've set up a value transformer for that image that takes the name of the image file stored in the datasource and prepends a URL path to load the file from the server it resides on.

    Is this similar to what you're trying to do? If so, then there is a section on Value Transformers in the DashCode doc. It's one of the few things that is documented! :)