I have this in jQuery:
$(function(){
function updateList(){
//HERE MY FUNCTION
}
});
And :
$(document).ready(function() {
updateList();
});
they are on the same file. When i load my page, i have ReferenceError: updateList is not defined
.
On Firefox and ie9 it's ok....
Do you have any ideas ? Thanks !
Edit : And bonus question, this code doesn't work on IE<9 :
$.ajax({
type: "GET",
url: "rechercheArtisan_ajax.html?action=metier&IDmetier="+secteur_activite,
dataType: ($.browser.msie) ? "text" : "xml",
success: function( data ) {
var xml;
if (typeof data == "string") {
xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async = false;
xml.loadXML(data);
} else {
xml = data;
}
// Returned data available in object "xml"
if ( $(xml).is("erreur") )
{
alert( "Erreur : " + $(xml).find("erreur").text() );
}
else
{
$("#id_metier").attr("disabled", "");
updateList( "metier" , $(xml).find("list") );
}
}
});
No error, nothing, just no effect.