📜  动态 img url - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:05.388000             🧑  作者: Mango

代码示例1
function dynamicUrl() {
  var url = "https://is1-ssl.mzstatic.com/image/thumb/Purple111/v4/dd/95/7e/dd957e3a-abd3-da8a-2211-726a67108938/source/256x256bb.jpg";
  return url;
}

var img = document.createElement("img");
img.src = dynamicUrl();
document.body.appendChild(img);
 Run code snippet