I have a case where i want to submit a form and get the response from this submit, because based on this response “at least submit complete response” i will make some other logic.
What makes my case is different that this form is on a domain and i am submitting it to another domain name so can’t use ajax submit due to cross script security issues.
Anyone face a case like this and have a solution?
I used JQuery code to submit the form:
$('#MyForm').submit();
Form code:
<form target="MyIframe" name="MyForm" id="MyForm"
action="http://mydomain/page.aspx" method="post"> </form>
For cross-domain communication there is no easy client-side way for you to retrieve results. Server-side support would be required – exposing additional services that you can hit on the client (for example by embedding a element into the page).
This allows you to make GET requests to the server and get the result as JSON. One way to do it would be:
<script src="http://otherdomain.com/gettoken"></script>This returns something like
var myToken = “ABC123”;
<script src="http://otherdomain.com/getresult?token=ABC123"></script>ABC123and returns then as JSON