0

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>
1
  • The link asks for username and password, and contains a space. Commented Aug 18, 2009 at 17:18

2 Answers 2

1

Here's more info on using a proxy.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.