简体   繁体   English

Javascript RSS Feed验证

[英]Javascript RSS Feed Validation

hello i want to create some thing like this, 你好,我想创造这样的东西,

http://mobile.conduit.com/create-app-m.aspx http://mobile.conduit.com/create-app-m.aspx

I need to validate rss feeds before submit form, 我需要先验证RSS供稿,然后再提交表单,

<form name="form1" id="form1">    
<input type="text" name="url" type="text" id="url" />
<input type="submit" name="submit" id="button2" value="Search"/>
</form>

if any one enter text in the url text box i need to check is it a valid rss feed (need to check even the one letter changes as http://mobile.conduit.com/create-app-m.aspx ** not in onchange event of textbox ) and i need to show loading gif when the validation is in process. 如果有人在url文本框中输入文本,我需要检查它是否是有效的rss提要(甚至需要检查一个字母是否更改为http://mobile.conduit.com/create-app-m.aspx **在textbox的onchange事件中),并且在进行验证时,我需要显示正在加载gif。 if it's success need to show another gif. 如果成功,则需要显示另一个gif。

and if it is valid rss, user can submit the form, otherwise he can't and should show a error message. 并且如果它是有效的rss,则用户可以提交表单,否则他不能并且应该显示错误消息。

hope a help for this. 希望对此有所帮助。 thanks. 谢谢。

You can't achieve this with client side JavaScript. 您无法使用客户端JavaScript来实现。 The same origin policy would prevent your code from accessing arbitrary URIs. 相同的原始策略将阻止您的代码访问任意URI。

You could either use a proxy on your system to request the data (and then build an RSS validator in JS) or get your server to do the validation and return a success or failure response. 您可以在系统上使用代理来请求数据(然后在JS中构建RSS验证器),也可以让服务器进行验证并返回成功或失败响应。 The latter would probably be easier due to the abundance of RSS libraries for most languages that are popular on the server. 对于服务器上流行的大多数语言,由于RSS库的丰富,后者可能会更容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM