我要显示这个URL的结果
http://api.openweathermap.org/data/2.5/weather?q=Berlin,de&mode=html&appid= ... 1
看起来像
/image/WWRoD.png
如何将 URL 中的 HTML 内容直接插入到 iframe 或 div 中? 谢谢!
最佳答案
如果您已经能够获得该响应 html,您需要做的就是将其插入到页面上
document.getElementById('mydiv').innerHTML = "<p>some html</p>"
关于javascript - 将 URL 中的 HTML 内容插入 HTML(表单、div、iframe 等),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53434842/