- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在处理一个经典的 ASP 项目,我使用 ASP Xtreme Evolution 来解析 JSon 数据(在此处找到:http://zend.lojcomm.com.br/entries/classic-asp-json-revisited/)
无论如何...我正确获取了大部分 JSON 数据,但现在我被困在一个数组上。
JSon 看起来像这样:
{
"Product": {
"ID": "6666",
"Name": "Tha name",
"ArticleGroup": [
{
"@handleas": "array",
"Title": "Title 1",
"Article": {
"ID": "777",
"Label": "Label 1",
}
},
{
"@handleas": "array",
"Title": "Title 2",
"Article": {
"ID": "888",
"Label": "Label 2",
}
}
]
}
}
}
ASP 看起来像这样:
set xmlHTTP = server.createobject("MSXML2.ServerXMLHTTP.6.0")
xmlHTTP.open "GET", "http://source.of.json", false
xmlHTTP.send()
ProductFeed = xmlHTTP.ResponseText
dim ProductInfo : set ProductInfo = JSON.parse(join(array(ProductFeed)))
dim key : for each key in ProductInfo.Product.keys()
Response.Write ProductInfo.Product.ID ' Prints 6666
Response.Write ProductInfo.Product.Name ' Prints Tha Name
Next
set ProductInfo = nothing
我的问题是我不知道如何访问 ArticleGroup 中的信息。我得到的只是 [object Object]、[object Object] 或一个空值。
有人有什么想法吗?
谢谢!
最佳答案
尝试以下操作(基于给定的 JSON):
Dim ArticleGroup
dim key : For Each key in ProductInfo.Product.keys()
Response.Write ProductInfo.Product.ID ' Prints 6666
Response.Write ProductInfo.Product.Name ' Prints Tha Name
For Each ArticleGroup In ProductInfo.Product.Get("ArticleGroup") '' iterate all ArticleGroup entries
Response.write ArticleGroup.Get("Title") '' get the correct key value
Next
Next
您需要遍历所有 ArticleGroup 条目并通过 .get(keyName)
获取值。否则它将返回 JScript 函数体。
关于json - 使用 ASP Xtreme Evolution 在经典 ASP 中解析 JSon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10499272/
我正在使用带有 Exchange Server 的进化电子邮件客户端。当我回复消息或转发时,之前的消息发生变化:每行后都会出现新的空行。 Hi? How are you? 变成了 Hi? How ar
我有 3 个独立的 modx evolution 网站。所有 3 个网站完全不同,因此运行单独的数据库。然而,对于每个网站的新闻和事件页面,我希望它们全部从 3 个网站中的 1 个的数据库运行。我这可
我正在尝试使用 django-evolution 修改现有项目中的某些模型。现在,当我使用 syncdb 时,它说我需要进行“进化”。 当我尝试运行时: python manage.py evolve
我工作的项目使用JOOQ 及其生成器从Postgres 数据库生成类。数据库演变由 Play Evolutions 管理。我们还使用 git 作为版本控制系统。当从 git 获取新的 evolutio
我必须在我的项目中使用 GeneXus X Evolution 2。但我对此一无所知。我也不知道如何在网页面板中使用这个工具,如何在其中编写程序。我完全是初学者。这对我来说是第一次。所以,我想从与 G
在Corda中,向状态添加新属性(状态演化)要求新属性可以为空,以便与该状态的先前版本向后兼容。 data class Version1DummyState( override val par
我正在使用 Evolutions 构建数据库。我的 1.sql 是: # User schema # --- !Ups create table user ( id` BIGINT NOT NUL
我有一个现有的 MySQL 数据库。现在我已经创建了一个 Slick 模型来查询所述数据库。 我现在的问题是:当我尝试将模型连接到现有表时,它不起作用。它说它需要进化。但是,当我在 Slick 中重命
我正在使用 Play! framework 2.0,我陷入了一个涉及数据库的恼人问题。 假设我有一个 User(扩展 Model)类,它有几个属性(first_name,last_name, 电子邮件
这个问题可能更适合另一个 SE 站点,如果是这样的话,我们深表歉意。基本上我们正在编写一个 HTML 电子邮件模板。它只是一个简单的表格布局,带有一些 td 样式和文本样式(a、b 和 span 的)
我在 Ubuntu 论坛上发布了以下问题,但尚未成功。我意识到这与其说是一个编程问题,不如说是一个 Evolution/Ubuntu 问题,但鉴于我想自动化解决方案,在这里发布它似乎并不合适.....
我在两个单独的 AVCS 模式文件中定义了记录的两个版本。我用命名空间来区分版本 SimpleV1.avsc { "type" : "record", "name" : "Simple",
这可能是一个愚蠢的问题,但我是新手! & 光滑。在使用 Slick 的 table.ddl.create 时我注意到它并没有创造进化,但应用程序仍然有效。 这会取代进化吗?我可以在生产中使用它吗?我是
我使用 Play 2.0 框架 和 Datomic 来实现持久性。到目前为止,我们通常手动安装数据库(并运行迁移),即通过 groovy 脚本从 *.edn 文件读取模式。 现在,我想将迁移转移到“E
我按照教程在 heroku 中部署了我非常简单的应用程序 当我通过 sbt run 运行它时,它在我的本地主机上运行良好但它在 heroku 上崩溃了! 这是我的 1.sql: # --- !Ups
我已将一个 modx 网站进化版本转移到另一个域,但在更改配置后在另一个域上,其管理器正在工作,但主网站意味着前 View 无法工作并给我错误。 《MODx 解析错误》MODx 在尝试解析请求的资源时
我有一个在 Genexus X Evolution 3 (U2) 中创建的智能设备在线应用程序,它启用了通知(目前仅适用于 android),但出于某种我不知道的原因,我无法注册设备稍后发送通知。这是
我正在尝试使用 Python 库 Pygmo2 ( https://esa.github.io/pagmo2/index.html ) 来并行化优化问题。 据我了解,并行化可以通过岛屿(在本例中为mp
我想使用 Evolution 邮件客户端的消息过滤器将电子邮件传送到我的 C++ 程序。我已经编写了一个 C++ 程序并在 Evolution 中设置了一个过滤器以通过管道传输到我的可执行文件。过滤电
我在 Evolution 电子邮件客户端中使用“管道到程序”选项,该选项运行以下 ruby 脚本 #!/usr/bin/ruby %% example code below junk_mail =
我是一名优秀的程序员,十分优秀!