在不知道其结构的情况下在网页中显示 Javascript 个对象
Display Javascript Object In WebPage Without Knowing Its structure
我想在网页中显示 javascript document
对象,其在控制台中的显示方式与作为下拉菜单打开的对象的显示方式相同。有没有什么方法可以像控制台一样在不知道结构的情况下在网页上显示一个 javascript 对象?
看看这个:
<html>
<head>
<script type="text/javascript">
for(var prop in document)
document.write(prop + ' = ' + document[prop] + '<br>');
</script>
</head>
<body></body>
</html>
我想在网页中显示 javascript document
对象,其在控制台中的显示方式与作为下拉菜单打开的对象的显示方式相同。有没有什么方法可以像控制台一样在不知道结构的情况下在网页上显示一个 javascript 对象?
看看这个:
<html>
<head>
<script type="text/javascript">
for(var prop in document)
document.write(prop + ' = ' + document[prop] + '<br>');
</script>
</head>
<body></body>
</html>