[jQuery] Replace part of a src= value
Hi All,
I am new to jQuery and am having a hard time figuring out what i am
looking for in the docs an don this forum.
What i want to do is create a little jquery script that checks to see
if the browser is msie and browser.version is 6.0
I have that part done:
jQuery.each(jQuery.browser, function(i, val) {
if(i=="msie" && jQuery.browser.version.substr(0,3)=="6.0") {
}
}
});
I was able to display an alert. cool.
now what I would like to do is if the above is true and the agent is
msie 6.0
then i want to find all <img> tags that have a src="some-image.png"
and replace the ".png" with ".jpg"
i think i need to use the [attribute$=value] selector.
and then write something that is the equivalent of
if ("img[source$='png']")
then replace ("img[source$='png']") with ("img[source$='jpg']")
but i don't know how to write javascript very well...
any help is appreciated.
cheers,
-e-