0
我知道,這樣做是可能的:傳遞參數給jQuery函數
$(document).ready(testing);
function testing(){
alert('hellow world!');
}
但我怎麼會做出這樣的工作,我想傳遞一個變量的函數:
$(document).ready(testing('hey world!'));
function testing(message){
alert(message);
}
這不是一個jQuery的功能,這簡直是一個jQuery包裝的範圍內的JavaScript函數。 –
你想要這個奇怪的例子嗎? –