Jquery Template does not work on HTTPS page

0

I have an AJAX function that works on several pages, except for a page that uses HTTPS:

$.ajax({
    url : url,
    type : "get",
    async: false,
    success : function(result) {

       console.log("Status AJAX: " + result.resultStatus);
       if(result.resultStatus == 'SUCCESS'){
           $('#div-select-filter-ligth-box').html(
               $('#select-ligth-box-template').tmpl({
                   lista : result.list
                })
           );
       }
       return false;
    },
    error: function() {
       console.log('AJAX Error');
    }
 });

I have already debugged the function and the AJAX returns this data. Does anyone know the cause of this problem?

    
asked by anonymous 22.09.2016 / 00:30

2 answers

0

Try adding Access-Control-Allow-Origin to the server header.

Access-Control-Allow-Origin: https://www.minhapagina.com

If you're using Google Chrome add the Cors extension to your browser: link

    
22.09.2016 / 01:53
0

The fact is that HTTP and HTTPS do not talk to each other (their description has this symptom). If the answer comes clean and the connection is encrypted the server will not understand it. Check your server configuration and make sure JavaScript is able to work on HTTPS.

    
22.09.2016 / 14:17