如何使用 jquery 加载外部 http xml 请求?

发布于 2024-08-02 09:10:33 字数 1287 浏览 2 评论 0原文

如何使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

妳是的陽光 2024-08-09 09:10:33

以下是有关使用代理的更多信息

Here's more info on using a proxy.

忆离笙 2024-08-09 09:10:33

浏览器拒绝访问外部站点以防止跨站点脚本编写。您可以使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文