- I cant use AJAX (XMLHTTPRequest) because of Same-Origin-Policy.
- I cant access the Server internals, neither do I have the Server-Code.
- The Server only supports HTTPMethods:
POST, OPTIONS
- I cannot use a third server (e.g. for using curl)
I can use a form-Post
<form method="post" action="some-web-server.com/something.JSON">
<input name="param" value="some JSON param" />
</form>
to get the answer but I getting redirected to the JSON.page to get the answer. Is there a possibility to get the response in JS? something like that:
<form target="javascript: someFunctionUsingTheResponse(this.submit())" method="post" action="someServer/st.JSON" >
and in the HTML-Head
<script type="text/javascript">
function someFunctionUsingTheResponse(text){
alert(text);
}
</script>
UPDATE:
I already tried to create an <iframe name="dummy">
and setting the target of the form to this dummy-iframe <form target="dummy">
which works quite good (in Chrome, not working in IE), but i still cannot access the data of the iFrame using JS. (origin Policy)