Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6159857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:12:07+00:00 2026-05-23T21:12:07+00:00

I have a little issue with a application wich is specified the following: I

  • 0

I have a little issue with a application wich is specified the following:

I need to send to a credit card payment webservice some data by post, so the webservice will proccess the information and return a XML.

I thought I could do it with the $.post() jQuery Ajax method.
That’s my code:

$.post("https://comercio.locaweb.com.br/comercio.comp", { 
identificacao: dadosPagamento[0], 
modulo: dadosPagamento[1], 
operacao: dadosPagamento[2], 
ambiente: dadosPagamento[3], 
bin: dadosPagamento[4], 
idioma: dadosPagamento[5], 
valor: dadosPagamento[6], 
pedido: dadosPagamento[7], 
descricao: dadosPagamento[8], 
bandeira: dadosPagamento[9], 
forma_pagamento: dadosPagamento[10], 
parcelas: dadosPagamento[11], 
autorizar: dadosPagamento[12], 
capturar: dadosPagamento[13] 
},
function(data) {
alert(data);
window.open('../negocio/index.php?mod=cliente&acao=gambs&xml=' + encodeURI(data));
$('#resultadoFinal').html(data);
}
);

The alert(data) I’m using just to test the response, and the problem is:
I send it to local test file (@ window.open('../negocio/...') ), and then the response is working ok, otherwise in the webservice (https://comercio.locaweb.com.br...) there’s no response, and the XML I’m waiting for doesn’t even exist.

Does anybody know what’s happening?
Or if I’m doing it the wrong way, could someone tell me a better way to get the XML sending data by Post?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:12:08+00:00Added an answer on May 23, 2026 at 9:12 pm

    Vinicius,

    It looks like you are trying to use ajax to interact with a web service running on another domain? Browsers will not allow this due to the fact that they follow the Same Origin Policy when making ajax requests.

    There are a number of methods to get around this limitation. One of which would be to host a proxy on your PHP site which performs the web request for you. Then your code can make the request the page that you host (which is allowed under the Same Origin Policy) but you are still able to call this service you require. There is a more detailed description of this limitation available on this page which even includes sample PHP code for this proxy page.

    There is also a JavaScript library called easyXDM (which is mentioned in the Wikipedia article above). This library will determine the best method to use to perform this cross-site communication based on the user’s browser. More information on this project is available here. I’m not sure how widely used easyXDM is in the wild, but I see that it does require that flash is installed on the user’s computer before IE6-7. This means that would be expected that any IE 6-7 users of your site would have to have flash installed in order to use this payment service (could be a potential headache).

    Personally I’m not a big fan of adding dependencies user dependencies like this unless I have to, so I would try to implement the proxy solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little issue with my hibernate logging configuration. In our application, we
I have little unusual problem to solve. I need some hint or links to
I have a little issue with AlertDialog on my application. I'm showing an AlertDialog
I have a little issue with setting align of a button in my application.
I'm developing a php application and I have a little issue with Apache and
I have a little issue about my application iOS. When i'm using the iOS
I'm having a little issue with an application I'm making. I have a page
I have the following application which replicates an issue I'm having in a larger
I have a little issue with my CSS: I have a hyperlink element which
I have a little issue concerning an animation-effect which loads a certain div into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.