.ajax button onclick 2 clics nécessaires sous FF.
Bonjour à tous,
voilà je vous expose mon problème:
j'ai une fonction qui charge un fichier xml et qui affiche les données dans un table html.
Cette fonction s'exécute correctement sous IE. Mais sous FF je dois cliquer deux fois sur le bouton pour que l'action s'exécute
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| function setPicData()
{
$(function ()
{
$('#picButtonId').click(function ()
{
$.ajax(
{
type : "GET", url : "picData.xml", dataType : "xml", success : function (data)
{
$("#picTableBody").empty();
$(data).find('pic').each(function ()
{
var $pic = $(this);
$("#picTableBody").append($('<tr>').append($('<td>').html($pic.find('pic_value').text())).append($('<td>').html($pic.find('legal_name').text())).append($('<td>').html($pic.find('address').text())).append($('<td>').html($pic.find('city').text())).append($('<td>').html($pic.find('country').text())));
})
}
});
});
})
} |
Ai-je manqué quelque chose ??
voici le fichier xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| <?xml version="1.0" encoding="UTF-8"?>
<pics>
<pic>
<pic_value>961950456</pic_value>
<legal_name>Dodaro</legal_name>
<address>via leonardo da Vinci , 53</address>
<city>Castrolibero</city>
<country>IT</country>
</pic>
<pic>
<pic_value>963046459</pic_value>
<legal_name>Viktimolosko drustvo Srbije</legal_name>
<address>Dositejava, 1A</address>
<city>Belgrade</city>
<country>RS</country>
</pic>
<pic>
<pic_value>968427825</pic_value>
<legal_name>80G, SA</legal_name>
<address>Rua do Moinho, -</address>
<city>Lourinhã</city>
<country>PT</country>
</pic>
<pic>
<pic_value>968764124</pic_value>
<legal_name>A.Davis t/a Lighthouse Design & Marketing</legal_name>
<address>4 Long Row, -</address>
<city>King's Lynn</city>
<country>UK</country>
</pic>
<pic>
<pic_value>963404389</pic_value>
<legal_name>Bangladesh Fisheries Research Forum</legal_name>
<address>House#354, Ground Floor, New DOHS, , Road#27</address>
<city>Mohakhali, Dhaka</city>
<country>BD</country>
</pic>
<pic>
<pic_value>968988194</pic_value>
<legal_name>PECHEURS DU NORD ET MANCHE</legal_name>
<address>rue du commandant Charcot, 16</address>
<city>Boulogne-sur-Mer</city>
<country>FR</country>
</pic>
<pic>
<pic_value>991008067</pic_value>
<legal_name>Technologie-Lizenz-Büro der Baden-Württembergischen
Hochschulen GmbH</legal_name>
<address>Ettlinger Strasse, 25</address>
<city>Karlsruhe</city>
<country>DE</country>
</pic>
<pic>
<pic_value>991011753</pic_value>
<legal_name>PRODUITS CHIMIQUES AUXILIAIRES ET DE SYNTHESE SA</legal_name>
<address>RUE BOSSUET, ZI DE LA VIGNE AUX LOUPS , 23</address>
<city>LONGJUMEAU</city>
<country>FR</country>
</pic>
<pic>
<pic_value>991011850</pic_value>
<legal_name>THALES SECURITY SOLUTIONS & SERVICES SAS</legal_name>
<address>Rue Grange Dame Rose, 20-22</address>
<city>VELIZY-VILLACOUBLAY</city>
<country>FR</country>
</pic>
</pics> |
Merci à tous pour votre aide