我有一個從CartoDB加載地圖的iframe。如果iframe未從URL加載,請加載縮略圖圖像
<iframe src='https://recology.cartodb.com/tables/condma_1_cleaned/embed_map' width='900' height='600'></iframe>
此iframe嵌入在html演示文稿中。當我在做演示時,可能不會有互聯網。在這種情況下,如果地圖的屏幕截圖會加載,那將會很不錯。
如何在加載實時版本時由於缺少互聯網訪問而導致地圖加載失敗?
一月底關閉BODY標記之前障礙是檢測負載故障,請參見[(1)](http://stackoverflow.com/questions/375710/detect-failure-to-load-contents-of-an-iframe),[(2)](http: //stackoverflow.com/questions/35240/retrieving-http-status-code-from-loaded-iframe-with-javascript?lq=1) - 那麼你只需要替換iframe與img尺寸相同。 jQuery使用['.replaceWith()'](http://api.jquery.com/replaceWith/)命令足夠簡單。 – Orbling
謝謝,正在研究該解決方案。 – sckott