从 3rd 方域中提取 div 以显示在我的网页上?
所以这就是我想做的: 我经营一个 Veetle.com 频道,在其中播放视频。 Veetle 允许您显示要播放的节目的时间表。我想直接从我的 Veetle 页面中剥离这个 div 容器中的信息,并将其显示在我的个人网页上。
最初,我尝试将 CSS 注入包含 Veetle 页面的 iframe 中,该页面删除了除包含时间表的 div 之外的所有内容。这并没有那么成功,因为显然这是不允许使用第三方域的。这已经成为一个巨大令人头疼的问题。
我不能只是使用内联样式表边距删除所有内容,因为仍然可以听到广播中的音频(即使它不可见)和这可能会让我的网页访问者感到非常困惑。 为了解决这个问题,我尝试了一些删除嵌入对象的 javascript,但我再次通过第三方域问题上的 iframe 遇到了整个脚本编写问题。
有人有什么想法吗?
So here's what I am trying to do:
I run a Veetle.com channel where I broadcast video. Veetle allows you to show the Schedule of programs to be played. I want to strip the information in this div container directly from my Veetle page, and display it on my personal webpage.
Originally I tried injecting CSS into an iframe containing the Veetle page that removed everything except the div containing the schedule. This didn't pan out so well, because apparently this is not allowed using 3rd party domains. This just became a HUGE headache.
I can't just chop everything out using inline stylesheet margins, because the audio from the broadcast will still be heard (even though it wouldn't be visable) & that could become very confusing to visitors of my webpage.
To solve this I tried some javascript that removes embedded objects, but I ran into the whole scripting through an iframe on a 3rd party domain problem again.
Anybody got ANY ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试在 Google 中搜索“XMLHttpRequest crossdomain”或类似内容。我之前在本地使用过 XMLHttpRequest,它在一个变量中返回结果,您可以将其他所有内容从中删除。我浏览过的几个网站似乎表明,只需发送一些额外的标头,它就可以在其他域上正常工作。
Try searching Google for "XMLHttpRequest cross domain" or something similar. I have used XMLHttpRequest locally before and it returns the results in a variable that you can strip everything else out of. The few sites I glanced at seem to indicate that it will work fine on other domains by sending a just a few extra headers.
您是否尝试过在服务器上创建代理页面。
您可以获取页面服务器端,去掉您需要的内容,然后将其写入代理页面,您可以通过 ajax、iframe 访问该代理页面或直接将其写入页面。
Have you tried creating a proxy page on your server.
You can fetch the page server side, strip out what you need then write it out to a proxy page that you can access via ajax, iframe or directly writing it out to page.