I have successfully updated the href value, but when clicked on the original link is active. But looking at the source, after the href is updated the value gets updated, but not when clicked on.
The temporary data I used was test, just so I can see if it effectively changed.
This is the code I have used:
<a id="productIMGLarge6128" href="http://www.mysite.com/originalLarge.jpg" title="MyLargeImage" class="floatbox">
<span class="zoomIcon""><img src="styling/zoom.png" alt="zoom" /></span>
<img id="productIMGSmall6128" src="http://www.mysite.com/originalSmall.jpg" alt="MySmallImage" />
</a>
The script
<script>
$(document).ready(function() {
$("#button").click(function(){
$("#button").spin("small", "#FFF");
$.ajax({
type: "POST",
url: "_/process/roofbox.php",
data: { color: "B", product: "6128" },
dataType: "json",
success: function(data){
$("#productIMGSmall6128").attr("src",data.productIMGSmall);
$("#productIMGLarge6128").attr("href","test");
$("#price6128").html(data.price);
console.log(data);
$("#button").spin(false);
}
});
return false;
});
});
</script>