简体   繁体   English

内嵌iframe的div

[英]div inside iframe hiding

I am playing with jquery. 我在玩jQuery。

I have loaded a wikipedia page into an iframe. 我已将Wikipedia页面加载到iframe中。 This was fun and good. 这很好玩。

Now, I want to remove an element from the wiki page I loaded inside the iframe (or maybe reload it into iframe without that element?). 现在,我想从我在iframe中加载的Wiki页面中删除一个元素(或者在没有该元素的情况下将其重新加载到iframe中?)。 As an example, say I want to remove the 'left-navigation' element or something similar. 例如,假设我要删除“向左导航”元素或类似内容。

Is this possible? 这可能吗? If so, how can I? 如果是这样,我该怎么办?

When you see the page source through your browser, does it show you everything? 当您通过浏览器查看页面源代码时,是否可以显示所有内容? if it does, then, yes it is possible to manipulate the content and show it in your website. 如果是这样,那么可以处理内容并将其显示在您的网站中。 I don't remember the exact functions, but I did something very similar a long time ago using PHP. 我不记得确切的功能,但是很久以前我使用PHP做过非常相似的事情。 steps included, loading the whole page content (including html tags) of a given url into a variable and then do a string search, find what you need, remove it and then echo the remaining in your website. 包括以下步骤:将给定url的整个页面内容(包括html标记)加载到变量中,然后进行字符串搜索,找到所需内容,将其删除,然后回显网站中的其余内容。 if you had problems figuring it out, leave a comment anywhere on "boombud dot com" and i'll try to be more specific. 如果您在解决问题时遇到问题,请在“ boombud dot com”上的任何地方发表评论,我会尝试更加具体。

You cannot. 你不能。 This is apart of the cross-domain policy. 这是跨域策略的一部分。 You cannot "mess with" so to speak, iframes that are loading a page from another domain. 可以说,您无法“与”“混乱”,即从另一个域加载页面的iframe。 Obviously, this does not apply to iframes linking to pages on your own domain. 显然,这不适用于链接到您自己网域上的网页的iframe。 This articles discusses some solutions and hacks on the issue: http://softwareas.com/cross-domain-communication-with-iframes 本文讨论了有关此问题的一些解决方案和技巧: http : //softwareas.com/cross-domain-communication-with-iframes

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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