“未终止的正则表达式文字”通过 javaScript 解析来自外部域的 XML 数据时出错
因此,我开始这个线程来修复我在实现 steven.yang 的答案时遇到的(可能是语法)错误 这个问题。
我尝试了他的建议此处,但收到错误:
未终止的正则表达式文字。
这看起来像是一个需要解决的小问题,但我自己不知道如何解决它。
谢谢!
update
由于使用 jsonp 会访问 xml 文件,是否可以告诉计算机忽略任何错误,只返回
标记的内容?
So I'm starting this thread to fix a (likely syntax) error I encountered while implementing the answer by steven.yang at this question.
I tried his suggestion here, but got the error:
Unterminated regular expression literal.
This looks like a minor thing to fix, but I myself am not sure how to fix it.
Thanks!
update
since using jsonp makes it access the xml file, would it be possible to tell the computer to ignore any errors, just return the content of the <webcite_url>
tags?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此 php 脚本会将外部 xml 文件复制到本地服务器。然后,这将允许您解析该文件。
我正在开发一个涉及使用外部数据的项目 - 当您想要更新 xml 文件时,您只需要执行此脚本。
This php script will copy an external xml file to your local server. This will then allow you to parse that file instead.
I'm just working on a project that involves working with external data- you'll just need to execute this script when you want to update the xml file.
您请求的 URL 不是 JSONP。
当浏览器尝试将 XML 响应解析为 Javascript 时,您会收到语法错误。
The URL you're requesting isn't JSONP.
You get a syntax error when the browser tries to parse the XML response as Javascript.