javascript - 替换给定的 <img> 来源

标签 javascript jquery google-weather-api

我用 Google Weather API 制作了一个插件,目前我正在从 Google 的 API 中提取图像。对于晴天,我正在拉 http://www.google.com//ig/images/weather/sunny.gif

我正在寻找一种方法,以便在拉出 sunny.gif 时,用我选择的图像替换。

使用 jQuery 或其他方式可能吗?

非常感谢

最佳答案

$("#my_image").attr("src","http://www.myimagepath.com/image.jpg");

关于javascript - 替换给定的 <img> 来源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7198849/

相关文章:

javascript - firebase 在 ('value' 上)等待不能按预期工作

javascript - 如何从传递给 "$(this)"方法的事件处理程序访问 "on"对象?

javascript - 应用 jqgrid 搜索过滤器工具栏

latitude-longitude - 使用带有 Lat 和 Lon 的 Google Weather API - 如何格式化?

php - Google Weather API 温度转换

javascript - 默认情况下,AngularJS ng-repeat 如何跟踪项目?

javascript - Typescript 0.9.1 : Very slow intellisense Should i go back to 0. 8.3 以获得更好的性能?

javascript - jQuery cookie 插件 : Setting a cookie for a year and after closing browser and re-opening - the cookie is gone

javascript - 检测用户何时在 div 外部单击

google-maps - 如何隐藏或显示 Google map 图层?