在一个框架中捕获页面? [英] Trapping a page in a frame?

查看:42
本文介绍了在一个框架中捕获页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用javascript,有没有办法在框架内捕获外部页面?

我看过脚本打破框架,但没有任何东西可以阻止页面被困

在一个框架中。

解决方案

smerf在21 okt 2006上写了comp.lang.javascript


使用javascript,有没有办法在

帧内捕获外部页面?我已经看到了打破框架的脚本,但没有任何东西可以保留一个框架中的页面。



从未看过网上的MS规范是做什么的?


< http://msdn.microsoft.com/workshop/a...jects/obj_loca

tion.asp>
< br $> b $ b =====================

可能:


if(top.location.href == location.href){

top.location.href =

''http://myDomain.xxx/ framespage.html?frame2 =''+ location.href


-

Evertjan。

荷兰。

(请在我的电子邮件地址中将x'变为点数)


smerfaécrit:


使用javascript,有没有办法在框架内捕获外部页面?

我看过要打破的脚本没有任何东西可以保持一个页面陷入困境

在一个框架中。



它是exacktely相同的方法(或相当)


if(self == top)location =''http: // mySever / mySite / index'';

或者回到正确的位置尝试类似:


if(self == top ||( parent.frames&&!parent.myFrameToMe)){

var url = self.location;

setTimeout(function(){parent.myFrameToMe.location = url ;},1000);

location =''http:// mySever / mySite / index'';

}


,当然你的主页上有一个名为''myFrameToMe'的框架。


(未经测试)

其他方式(法文):
http://stephane.moriaux.perso。橙色...... e_en_frame.htm


-

ASM


将这项工作用于捕获别人的框架?


基本上我想制作一个网站如 www.torrentscan.com (提防

刺激性popup)但是用于教育链接。一些可能添加了b
的网站会尝试突破主要内容框架。


据我所知,大多数试图破解的网页超出框架这样做是为了让其他人声称内容是他们自己的(窃取内容)。 Hpwever,

因为我没有声称他们的内容是我自己的,我也没有以任何方式改变他们的

内容,我希望能够强迫他们留在下一个框架

到我的搜索框/侧边栏,如 www.torrentscan.com (再次提防

恼人的弹出窗口)。


他们的链接页面可能还有另外一个问题。如果用户想要为他们的页面添加书签,那么从我的框架页面这样做将不允许直接链接

。我想添加一个添加到收藏夹每个页面上面的按钮

他们的页面允许用户直接将框架页面添加到他们的b / b
书签/收藏夹。


是这个很容易做到的事情?我是否应该使用另一个框架 -

就在主要内容框架的正上方?并且,javascript可以读取和

操纵其他帧中的页面(获取URL和描述)甚至

虽然其他帧包含来自其他域的内容吗?


非常感谢你的帮助。我是javascript的新手,并试图学习所有我能做到的事情。事实上,任何一个方式(即不在Google的前五十名)和好的Javascript代码/黑客/教程的链接也将是赞赏的。

赞赏。 />

愿你的骆驼知道每个绿洲的位置。


" ASM" < st ********************* @ wanadoo.fr.invalidwrote in message

news:45 ******* **************** @ news.orange.fr ...


smerfaécrit:
< blockquote class =post_quotes>
>使用javascript,有没有办法在框架内捕获外部页面?
我看过脚本打破框架,但没有什么可以保持页面
被困在一个框架中。




它是exacktely相同的方法(或相当)


if(self == top)location = ''http:// mySever / mySite / index'';


或者回到正确的地方尝试类似:


if (self == top ||(parent.frames&&!parent.myFrameToMe)){

var url = self.location;

setTimeout(function() {parent.myFrameToMe.location = url;},1000);

location =''http:// mySever / mySite / index'';

}


当然你的主页上有一个名为''myFrameToMe'的框架。


(未经测试)


其他方式(法语):
http://stephane.moriaux.perso.orange...e_en_frame.htm


-

ASM



Using javascript, is there a way to trap an external page inside a frame?
I''ve seen scripts to break out of frames, but nothing to keep a page trapped
in a frame.

解决方案

smerf wrote on 21 okt 2006 in comp.lang.javascript:

Using javascript, is there a way to trap an external page inside a
frame? I''ve seen scripts to break out of frames, but nothing to keep a
page trapped in a frame.

Never looked at MS specs on the web doing that?

<http://msdn.microsoft.com/workshop/a...jects/obj_loca
tion.asp>

=====================

possibly:

if (top.location.href == location.href) {
top.location.href =
''http://myDomain.xxx/framespage.html?frame2=''+location.href

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


smerf a écrit :

Using javascript, is there a way to trap an external page inside a frame?
I''ve seen scripts to break out of frames, but nothing to keep a page trapped
in a frame.


it is exacktely same method (or quite)

if(self == top) location=''http://mySever/mySite/index'';
Or to go back in right place try something like :

if(self == top || (parent.frames && !parent.myFrameToMe)) {
var url = self.location;
setTimeout(function() { parent.myFrameToMe.location=url; },1000);
location = ''http://mySever/mySite/index'';
}

and of course you have a frame named ''myFrameToMe'' on your main page.

(not tested)
other way (in french) :
http://stephane.moriaux.perso.orange...e_en_frame.htm

--
ASM


Will this work for trapping someone else''s frames?

Basically I want to make a site like www.torrentscan.com (beware of the
irritating popup) but for educational links. Some of the sites that may be
added will try and break out of the main content frame.

As I understand it, most pages that try and break out of frames do so to
keep others from claiming content as their own (stealing content). Hpwever,
since I am not claiming their content as my own, nor am I altering their
content in any way, I want to be able to force them to stay in a frame next
to my searchbox/sidebar like on www.torrentscan.com (again, beware of the
irritating popup).

There is one other issue that they may have with my links page. If a user
wanted to bookmark their page, doing so from my framed page would not allow
that direct link. I''d like to add an "Add to favorites" button above each
of their pages to allow users to add the framed pages directly to thier
bookmarks/favorites.

Is this a pretty easy thing to do? Should I do it with yet another frame -
just right above the main content frame? And, can javascript read and
manipulate pages in other frames (to get the URL and description) even
though the other frames contain content from other domains?

Thanks soooooo much for your help. I''m new to javascript and trying to
learn all that I can. In fact, any out of the way (i.e. no in the top 50 on
Google) links to good Javascript code/hacks/tutorials would also be
appreciated.

May your camel know the location of every oasis.

"ASM" <st*********************@wanadoo.fr.invalidwrote in message
news:45***********************@news.orange.fr...

smerf a écrit :

>Using javascript, is there a way to trap an external page inside a frame?
I''ve seen scripts to break out of frames, but nothing to keep a page
trapped in a frame.



it is exacktely same method (or quite)

if(self == top) location=''http://mySever/mySite/index'';
Or to go back in right place try something like :

if(self == top || (parent.frames && !parent.myFrameToMe)) {
var url = self.location;
setTimeout(function() { parent.myFrameToMe.location=url; },1000);
location = ''http://mySever/mySite/index'';
}

and of course you have a frame named ''myFrameToMe'' on your main page.

(not tested)
other way (in french) :
http://stephane.moriaux.perso.orange...e_en_frame.htm

--
ASM



这篇关于在一个框架中捕获页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆