Replace Image src

replace_image_src(<sel>, <url>)

Replace the source of the image tag having ID of <sel> with the given URL. The effect is that the picture changes without flicker on modern browsers if the image tag has height and weight attributes and replacement image has the same size.

replace_image_src("#foo", "http://example.com/image.jpg")

See this action in action!

ruleset a60x124 {
  meta {
    name "Replace Image source Example"
    author "Mike Grace"
    description <<
      Replace Image source Example for documentation
    >>
    logging on
  }
  dispatch {
    domain "docs.kynetx.com"
  }
  rule newrule is active {
    select using "http://docs.kynetx.com/krl/kynetx-rule-language-documentation/actions/replace-image-src/" setting ()
    replace_image_src("#kynetx_image", "http://docs.kynetx.com/files/2010/01/switch_02.jpg");
  }
}