internet explorer - Javascript: replace a string in element.src attribute -
Hi, I am currently trying to change a query string value in the source attribute of the A link.
This works fine in Firefox but not.
Example:
& lt; Id = "link" href = "#" src = "http://somedomain.com? Id = 123 & amp; size = 20" & gt; Link & lt; / A & gt;
Then it looks like on my JS:
var link = document.getElementById ('link'); Link.src.replace ('size = 20', 'size = 45');
That is, it gives something like the source is not an object error;
Is lending any kind of hands enough?
Also, I do not recommend this as a solution for the need to be on the original javascript.
To get it to work in IE, you need to type link.setAttribute ( 'Src', ...)
.
Comments
Post a Comment