有没有办法在javascript控制台中将上下文更改为iframe?
I would like to change the context of the javascript executed in the webkit developer tool/firebug console to execute its code like it is running from inside an iframe on the page.
我想改变在webkit开发人员工具/ firebug控制台中执行的javascript的上下文来执行它的代码,就像它从页面上的iframe内部运行一样。
I know I could do this by opening the page in the iframe on a separate page, but I want to run code where it interacts with the parent frame.
我知道我可以通过在单独的页面上打开iframe中的页面来实现这一点,但我希望在与父框架交互的地方运行代码。
6 个解决方案
#1
129
Chrome 15 allows you to change the scope of the console. On the bottom of the console, next to the clear console button, there is a menu that says <top frame>
which will give a list of available frames:
Chrome 15允许您更改控制台的范围。在控制台的底部,在清除控制台按钮旁边,有一个菜单显示
Firefox has a similar feature currently in development:
Firefox目前正在开发类似的功能:
You can also navigate across frames using the command line:
您还可以使用命令行在框架中导航:
var frame = document.getElementById("frame1").contentWindow;
cd(frame);
更多相关文章
- 控制台在node . js中没有“debug”方法吗?
- Bottle 框架源码学习 四
- 在CentOS 6.3 64bit上搭建python高性能框架gevent开发环境
- Scrapy框架--Requests对象
- IIS 部署 python web框架 Flask
- Python第十天 print >> f,和fd.write()的区别 stdout的buffer 标
- 基于scrapy框架的关于58同城招聘网站信息的爬取
- python3编写网络爬虫21-scrapy框架的使用
- python 之 自制测试框架