DOM 遍历 JavaScript
如何从此处获取图片门户的值
-Screen
- Customers
+ 0
+ 1
- 2
+testings
- Portals
-pictureportal
+ 0
- 1
- name "portal 1"
上面是它在 firefox DOM 中的呈现方式。我想提醒图片门户中名称的值 我尝试过
alert(Screen.Customers[2]['Portals']['pictureportals'][1]['name']);
但没用
how to get the value out of the picturesPortals from here
-Screen
- Customers
+ 0
+ 1
- 2
+testings
- Portals
-pictureportal
+ 0
- 1
- name "portal 1"
Above is how it renders in firefox DOM. I want to alert out the value of name in pictureportal
I tried
alert(Screen.Customers[2]['Portals']['pictureportals'][1]['name']);
But that didnt work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您并没有尝试遍历 DOM,而是访问深层对象属性。
如果这是正确的,它会是这样的:
请注意,我使用的是
pictureportal
而不是pictureportals
。It doesn't seem like you're trying to walk the DOM, but access a deep object property.
If that's right, it would be something like this:
Note that I'm using using
pictureportal
and notpictureportals
.