나는 jQuery를이 있습니다jQuery를이 기능 만 IE에서 정의되지 않은 <9
$(function(){
function updateList(){
//HERE MY FUNCTION
}
});
그리고 :
$(document).ready(function() {
updateList();
});
는 같은 파일에있는합니다. 내 페이지를로드 할 때 ReferenceError: updateList is not defined
이 있습니다.
Firefox 및 ie9에서는 괜찮습니다. ...
어떤 아이디어가 있습니까? 감사 !
편집 : 그리고 보너스 문제는,이 코드는 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"));
}
}
});
없음 오류, 아무것도, 그냥 아무런 영향을.
'$ (function() {});'및'$ (document) .ready (function() {}); 'updateList()'함수 호출을 같은 래퍼에 넣으십시오. – zakangelle
'updateList '의 범위는'$ (function() {});'안에 있습니다. 어느 브라우저에서나 그렇게해서는 안됩니다. 어쨌든 왜 2 개의 다른 준비 처리기가 필요합니까? 하나의 처리기로 처리 할 수 있습니다. –
http://jsfiddle.net/DQnsK/ - 나는 당신이 찾고있는 것이라고 믿습니다. – tymeJV