$(document).ready(function() {
doSomething(1);
$('#pp').click(doSomething(2));//why is this called?? I didn't click the button..
});
function doSomething(v) {
alert(v);
}
</script>
<body>
<input type="button" id="pp" value="asdf" />
로드 할 때 호출하고 클릭해야하는 함수가 필요합니다. 하지만 어떻게 든 doSomething()
은로드시 두 번 호출됩니다. 무슨 일이야..??내 기능이 두 번 호출되는 이유는 무엇입니까?
볼 수있는 준비가 조각 : http://stackoverflow.com/questions/2316158/jquery-how-do-you-pass-this-as- 함수 매개 변수/2316194 # 2316194 – deceze
정말 내 질문에 대답 해 주셔서 감사합니다. – Deckard