且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在WCF数据服务AtomPub源上设置自定义内容类型响应标头

更新时间:2022-02-18 21:19:40

您可以阅读
responseText
value作为XHR对象的字符串,然后使用MSXML DOMDocument对象解析它。有一个样本
这里的
显示了如何在尝试其中一个标志的情况下从文本创建文档;对于Web情况,你会想要使用MSXML 6并将ProhibitDTD设置为true(默认值,所以没什么可做的)。

You can read the responseText value as a string from the XHR object, then parse it using an MSXML DOMDocument object. There is a sample here that shows how to create a document from text in the context of trying out one of the flags as well; for the web case, you'll want to use MSXML 6 with ProhibitDTD set to true (the default value, so nothing to do really).

请注意,其他浏览器都有
DOMParser
也可以执行此操作。

Note that other browsers have an DOMParser object to do this as well.