1
jquery 함수 내부에서 전역 변수를 어떻게 변경합니까? 아래 코드를 사용하면 "15"가 아니라 "0"이 표시됩니다.jquery 함수 내 전역 변수 변경
<script type>
theValue=0;
$(document).ready(function(){
theValue=15;
});
</script>
<script type="text/javascript">
document.write(theValue)
</script>
' document.write (theValue)'가 실행됩니다. – Matijs
+1 Matijs의 답변 – Craig