如何使用 jquery 加载外部 http xml 请求?
如何使用 jquery 加载外部 http xml 请求?
下面是粘贴到 Firefox 等 Web 浏览器中时的 url,会显示 xml 文档。
这是针对 CPanel XML API 的。
http://hostingz.org:2086/xml-api/createacct?username=WeAreWatching&plan=hostingz_FH5&ip=n&cpmod=x3&password=changeme&contact [电子邮件受保护]&domain=thewaw blog&userregns=0&reseller=0
我该怎么做在 jquery 中工作?
<head>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
type: "GET",
url: "http://hostingz.org:2086/xml-api/createacct",
dataType: "html",
success: function(xml) {
$("#final").append("<img src=\"icons/tick.png\" align=\"left\">Account Creation Successful!<br>The free account was created successfully!!<br><br>The account details have been sent to the email.<br><br>");
}
});
});
</script>
</head>
How do I load an external http xml request with jquery?
Below is a url when pasted into a web browser like firefox, an xml document is shown.
This is for the CPanel XML API.
http://hostingz.org:2086/xml-api/createacct?username=WeAreWatching&plan=hostingz_FH5&ip=n&cpmod=x3&password=changeme&contact [email protected]&domain=thewawblog&useregns=0&reseller=0
How do I make this work in jquery?
<head>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
type: "GET",
url: "http://hostingz.org:2086/xml-api/createacct",
dataType: "html",
success: function(xml) {
$("#final").append("<img src=\"icons/tick.png\" align=\"left\">Account Creation Successful!<br>The free account was created successfully!!<br><br>The account details have been sent to the email.<br><br>");
}
});
});
</script>
</head>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是有关使用代理的更多信息。
Here's more info on using a proxy.
浏览器拒绝访问外部站点以防止跨站点脚本编写。您可以使用 Google API 发出此类请求,或使用服务器端代码。
The browser denies access to external sites to prevent cross site scripting. You can use the Google API to make such requests, or use server side code.