简体   繁体   中英

How to embed widget via iframe that resizes according to content height

I have an web page that is a widget and has to be embedded on another website (the domain is not the same)

I tried using the iframe approach

This works but the problem is that the height of my page increases according to the height. I cannot use javascript to access the content height because the domain is different and the call is blocked due to cross site scripting.

Is there any easy solution available for this problem.

one option would be to make a little mini API on the widget side.

calculate the height. and let the other webpage get that information via JASONP(which is basically cross site scripting).

heres some info about JASONP What is JSONP all about?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM