Send a message to another domain using JS

I would like a mail request to be sent after changing a specific text input field using javascript.

So here is my current code:

<input name="message" onchange="$.ajax({type: \"POST\", url: \"http://example.com/example.php\", data: \"message=\" + document.getElementsByName(\"message\")[0].value});" />

Now it works with a normal connection, but does not work on a secure connection (SSL). I mean, the page is protected, but the request is sent to the unprotected page.

Is there a solution?

+5
source share
2 answers

Set the target attribute of the form to point to a hidden iframe.

You cannot read the answer, but you can make a request.

If you want to read the answer, you need to proxy the request through your own server.

+2
source

, t POST - ( ) . JSON-P , DOM, .

AJAX w/GET JSONP: JSONP CrossDomain

, JSONP w/jQuery

script . , , . http://rj3.net/mdc/sop

, ssl URL- ajax, ssl, , https

https http-. https- (html ) /ssl. , (https to http). , https, URL- -

0

All Articles