JQuery GET does not send IE in browsers

I have the following piece of code in a project that I am working on:

if(!validate($(".emailbody input").val())){ ... } else{ $.get("https://get.request.com/something", {email:encodeURI($(".emailbody input").val())}) .complete(function(){ $(".emailbody").append($('<p class="emailsucess">Kiitos! Linkki rekisteröitymisen jatkamiseen on lähetetty sähköpostiisi: '+$(".emailbody input").val()+'</p>')); $.post("http://post.request/confirm.php", {"confirm":$(".emailbody input").val()}) $(".emailbody input").val(""); }); } 

A simple get requst puts things in the database of the connected service, and then the post-response starts the mail from the local host.

My problem is this:

In any browser other than IE (any version), this works quite successfully and without any problems, however with IE, the GET call does not even appear in network traffic, it is ignored, not called, but the full call is still executed as if he went through OK!

Is this a problem with the https service, or is there something I missed?

UPDATE: I ran into a problem making a mail call to a local file that links to a GET request to an external server, so it works now, but it's a dumb way to do something. Anyone who can shed light on this will be very grateful.

+4
source share
1 answer

Sounds like a caching issue. GET requests can be cached, so you can try adding a random querystring parameter to the URL to avoid this. Or use $.ajax with cache: false :

 $.ajax({ url: 'https://get.request.com/something', type: 'GET', data: { email: $(".emailbody input").val() } // <-- note that you don't need to encode here, jQuery will take care of this cache: false, success: function(result) { ... } }); 

Also make sure that you apply to the same publishing policy rule . The best way to provide this is to use relative URLs. Therefore, instead of:

 'https://get.request.com/something' 

using:

 '/something' 
+6
source

All Articles