gpt4 book ai didi

html - 在 iframe 中加载页面片段

转载 作者:太空宇宙 更新时间:2023-11-04 13:25:12 27 4
gpt4 key购买 nike

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

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

</iframe>

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

最佳答案

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

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

关于html - 在 iframe 中加载页面片段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9096022/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com