Visual Studio 2015:在JavaScript控制台中看不到对象内容 [英] Visual studio 2015: can't see objects content in javascript console
问题描述
我以前曾经看过我所有的javascript对象内容:
I used to see all my javascript objects content like this before:
但是现在,我不知道为什么,但是它根本不显示其内容:
But now, I don't know why but it doesn't show their content at all:
我将Visual Studio 2015社区与Cordova和Ripple模拟器一起使用. 我试图创建一个新项目,甚至试图卸载/重新安装VS2015,但没有成功. 为使内容更清楚,我不再在对象左侧添加展开切换"按钮. 您对原因有任何想法吗?我只是像以前一样使用console.log和console.error.
I use visual studio 2015 community with cordova and Ripple emulator. I tried to create a new project or even tried to uninstall / reinstall VS2015, but it didn't work. To make it more clearly, I don't have the "expando-toggly" button on the left of my objects any more. Do you have any idea about the reason ? I just use console.log and console.error as I always did before.
推荐答案
为使内容更清楚,我的对象左侧不再有展开切换"按钮.您对原因有任何了解吗?
To make it more clearly, I don't have the "expando-toggly" button on the left of my objects any more. Do you have any idea about the reason ?
console.log
/console.error
带有两个参数,第一个是参数是字符串消息,它将在js控制台中打印为字符串.第二个是对象消息,它可以像对象一样扩展.
console.log
/console.error
take two arguments, the first is argument is the string message, which will be printed as a string in js console. The second is the object message, which can be expanded like an object.
因此,如果要在javascript控制台中记录该对象.您只需要将对象作为第二个参数传递给console.log
/console.error
.
So if you want to log the object in javascript console. You simply need to pass the object as the second argument to console.log
/console.error
.
例如:
var parentElement = document.getElementById('deviceready');
console.log("parentElement: ", parentElement);
和结果:
这篇关于Visual Studio 2015:在JavaScript控制台中看不到对象内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!