Bonjour,
Le script suivant fonctionne très bien avec un fichier XML en local mais si je mets :
url:"http://www.monserveur.com/fichier.xml" ... cela ne fonctionne plus.
Avez-vous une idée ? Merci !!!!
Voici le script :
<script>
$(document).ready(
function()
{
$.ajax( {
type: "GET",
url:'fichier.xml',
dataType: "xml",
success: function(xml)
{
$(xml).find('cours').each(
function()
{
$(xml).find('item').each(
function()
{
var id = $(this).attr('id');
var nom = $(this).find('nom').text();
var valeur = $(this).find('valeur').text();
$('<div class="items" id="link_' + id + '"></div>').html('<a href="' + nom + '">' + nom + ' ' + valeur + '</a>').appendTo('#Div_XML');
});
});
}
});
}
);
</script>
Le script suivant fonctionne très bien avec un fichier XML en local mais si je mets :
url:"http://www.monserveur.com/fichier.xml" ... cela ne fonctionne plus.
Avez-vous une idée ? Merci !!!!

Voici le script :
<script>
$(document).ready(
function()
{
$.ajax( {
type: "GET",
url:'fichier.xml',
dataType: "xml",
success: function(xml)
{
$(xml).find('cours').each(
function()
{
$(xml).find('item').each(
function()
{
var id = $(this).attr('id');
var nom = $(this).find('nom').text();
var valeur = $(this).find('valeur').text();
$('<div class="items" id="link_' + id + '"></div>').html('<a href="' + nom + '">' + nom + ' ' + valeur + '</a>').appendTo('#Div_XML');
});
});
}
});
}
);
</script>



