fichier html et Ajax (Jquery)
Bonjour,
Le code javaScript (Jquery) ci-dessous ne fonctionne pas si j'ouvre le fichier html via 'ouvrir->fichier' du navigateur, mais fonctionne si j'y accède via "http://localhost:8083/wsReferenciel/stattest.html"
Code:
1 2 3 4 5 6 7 8 9
|
$(document).ready(function() {
$.getJSON("http://localhost:8083/wsReferenciel/magasins",{annee:'2009', mois: '01'}, function(j){
var options = '';
for (var i = 0; i < j.length; i++) {
options += '<option value="' + j[i].code + '">' + j[i].nom + '</option>';
}
$("select#listMag").html(options);
}); |
Il semble impossible de faire appel à un appel ajax à partir d'un fichier html ouvert via 'fichier -> Ouvrir' dans un navigateur Web, c'est à dire sans être héberger sur le serveur qui fournit le service Ajax.
Est-il possible de résoudre ce problème ?
Besoin d'aide !!