/ / AJAX non funziona su https: javascript, jquery, html, ajax

AJAX non funziona su https - javascript, jquery, html, ajax

Dal momento che sto usando https sul mio server web, AJAX con una funzione di aggiornamento automatico di un div non funziona. Quando utilizzo HTTP, tutto funziona bene. Qualcuno può aiutarmi?

Ecco il codice che sto usando:

<b>
<div id="showMessages">
<script src=http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
function autoRefresh_div() {
$("#showMessages").load("showMessages.php"); // a function which will load data from other file after x seconds
alert("Auto-Refresh works fine");
}

setInterval("autoRefresh_div()", 5000); // refresh div after 5 secs
</script>
<?php include("showMessages.php"); ?>
</div>
</b><br>

Il div è anche disponibile. Grazie a tutti

risposte:

0 per risposta № 1

Ho risolto questo problema in questo modo:

<script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
setInterval(function() {
$("#showMessages").load("showMessages.php")
}, 2000);
});
</script>