ajax以xml形式获取xhtml文件

dgh_85 2010-04-03 01:18:38
ajax以xml形式获取xhtml文件
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:widget="http://www.netvibes.com/ns/">
<head>

<meta name="author" content="John Doe" />
<meta name="description" content="A descriptive description" />

<meta name="apiVersion" content="1.0" />
<meta name="debugMode" content="true" />

<link rel="stylesheet" type="text/css"
href="http://www.netvibes.com/themes/uwa/style.css" />
<script type="text/javascript"
src="http://www.netvibes.com/js/UWA/load.js.php?env=Standalone"></script>

<widget:preferences>
<preference name="hellowho" type="text" label="Hello who ?"
defaultValue="World" />
</widget:preferences>

<title>Title of the Widget</title>
<link rel="icon" type="image/png"
href="http://www.netvibes.com/favicon.ico" />

<script type="text/javascript">
var HelloWidget = {
toWhom: false,

parse: function(toWhom) {
if (toWhom) HelloWidget. toWhom = toWhom;
widget.setBody('<p> Hello ' + HelloWidget. toWhom + '!</p>');
}
}

widget.onLoad = function() {
var url = 'http://example.org/api.php?hello=' + widget.getValue('hellowho');
UWA.Data.getText(url, HelloWidget.parse);
}
</script>
</head>
<body>
<p>Loading...</p>
</body>
</html>


ajax以html形式获取后 responseXML.documentElement为空?
...全文
73 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
leonbingo 2010-04-06
  • 打赏
  • 举报
回复
http://www.w3school.com.cn/xml/xml_validator.asp

请用这个验证器验证你的xml文本,在IE下运行,发现有错误,这可能是导致无法读取的原因
随风落梦 2010-04-06
  • 打赏
  • 举报
回复
友情帮顶^^^^^^^^^^^
ailin84 2010-04-06
  • 打赏
  • 举报
回复
对你用的这个类库(?)不熟习,帮顶。

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧