I need to change the src for an html image tag from relative to absolute url.
src
I am using the following code. urlRelative and urlAbsolute are created correct
The replace method in Javascript returns a value, and does not act upon the existing string object. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
In your example, you will have to do
$(this).attr("src", $(this).attr("src").replace(...))