Detect if the iframe content has loaded successfully

前端 未结 6 941
天命终不由人
天命终不由人 2020-11-27 19:11

I have a widget that contains an iframe. The user can configure the url of this iframe, but if the url could not be loaded (it does not exists or the user does not have acce

6条回答
  •  抹茶落季
    2020-11-27 19:32

    Nowadays the browsers have a series of security limitations that keep you away from the content of an iframe (if it isn´t of your domain).

    If you really need that functionality, you have to build a server page that have to work as a proxy, that receive the url as a parameter, test if it is a valid url, and does the redirect or display the error page.

提交回复
热议问题