在iframe中加载页面片段



尝试加载页面片段,或者至少跳转到div,但没有任何乐趣。

<iframe src="http://myurl.com/#property_details" width="300" height="300">  
    </iframe>

但是iframe不会跳到请求的div,它只是加载整个页面,滚动到顶部。

不要认为这样做是可能的。另一种方法是使用div,通过Ajax调用将div的内容设置为#property_details。

这可能会有所帮助:http://frinity.blogspot.com/2008/06/load-remote-content-into-div-element.html.在该示例中,使用了页面的整个html,但可以通过在之前的数据上添加一些jQuery选择来选择要插入的内容。

最新更新