开发者

IFrame alternatives

Is there anythin开发者_StackOverflow中文版g else I could use instead of an iframe on my web page by where I still need to pass a url or is iframe it?

Thanks.


Since you put jQuery as a tag I suggest you either look at http://api.jquery.com/load/.


You can use an ajax request to fetch the content and then just inject it into the page but that won't work cross domain, so if you're trying to host external content iframe is the way to go.


you can create a div and fill this div in multiple ways, either do an ajax request or if you're using any server scripting language you can just do an include inside the div.

using iframes is still the cleanest options for most uses.


You'll need to tell us a bit more about what you're trying to do so we can help you out a bit more.

It sounds like an HTTP Request/AJAX might fit the bill, but its hard to say at the moment.


I don't think there is anything else you can use, as an alternative to an iframe. Considering the fact, that the URL will change upon clicking on any link inside the iframe, will change the content. This, otherwise can be a tedious and challenging. The moment you click a link, you are bound to be redirected to it. Hence, no.


There is no other option for crossdomain embedding unless you use the HTML <frameset> element, which I strongly do not recommend. You can, however, hide the iframe using CSS.

Crossdomain communication can be done in a variety of ways as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜