[英]Chrome Javascript Console - Reference to object output with console.log(obj)?
Is there a way to get a javascript
reference to an object that was output to the chrome console? 有没有办法获得一个
javascript
引用输出到chrome控制台的对象?
For example, say I had the following javascript: 例如,假设我有以下javascript:
top.it = {hi:'there'};
console.log(top.it);
This would output to the chrome console as 这将输出到chrome控制台
Object {hi: "there"}
I do this alot, and sometimes would like to get a reference to the object in the console, to run methods on it, and things like that. 我做了很多,有时想在控制台中获取对象的引用,在其上运行方法,以及类似的东西。
Is there a way to get a reference to objects that have been output using console.log
? 有没有办法获得对使用
console.log
输出的对象的引用?
I know there's a way to get references to recently inspected items (eg $0
), but this isn't for inspected items... 我知道有一种方法可以获得对最近检查过的物品的参考(例如
$0
),但这不适用于检查过的物品......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.