Visual studio 2015: can't see objects content

2019-09-16 12:25发布

I used to see all my javascript objects content like this before:

My objects' content before

But now, I don't know why but it doesn't show their content at all:

My objects' content now

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.

1条回答
太酷不给撩
2楼-- · 2019-09-16 12:40

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 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.

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.

ex:

var parentElement = document.getElementById('deviceready');
console.log("parentElement: ", parentElement);

and the result: enter image description here

查看更多
登录 后发表回答