我在一个页面上有一个图像,图像上已经存在src,但我想通过加载外部页面img src来替换它,并用新的替换它。下面是我的代码,但它不起作用。你能看到错误吗?
<script>
$(document).ready(function()
{
$dataImportURL = "/tv.aspx";
$(".videoThumbContainer img.attr('src')").load($dataImportURL + " #mediaImageContainer img.videoThumbImage.attr('src')");
});
</script>
<div class="videoThumbContainer"><a class="videoPath" href="http://mydeo.vo.llnwd.net/o1/u/m3/b71658af521441fbb2dfbe71399ef1a1.mp4"><span class="videoThumbPlayBtn"></span><img class="videoThumbImage" src="/Assets/Manchester Arndale/3b37d9cf-3819-4b41-8efd-8464f513046e.jpg" /></a></div>
答案 0 :(得分:0)
从这里开始:
$dataImportURL = "http://images2.wikia.nocookie.net/__cb20120925054351/victorious/images/a/aa/Puppy1.jpg";
$(".videoThumbContainer img").attr('src', $dataImportURL)