我試圖通過story_id到最裏面的內聯函數,但它始終爲0,即使它不是以0外部函數。我如何傳遞這個值?如何將參數傳遞到內聯javascript函數
function activateSearch(){
if($('story_filter')) Event.observe('story_filter', 'keyup',
function(event) {
$('stories_table').select(".story").each(
function(story) {
story_id = story.id.split('_')[1];
story.select('.tableCell', '.indexCardContent').each(
function(task, story_id) {
hideStoryRow(story_id);
task_filter = new RegExp($F('story_filter'), "i");
if (task.innerHTML.match(task_filter))
{
showStoryRow(story_id);
throw $break;
}
}
);
}
);
}
);
}
變量`story_id` *爲*已經全球性的,因爲它是這裏介紹沒有`var`聲明。如果你有顯示在您的示例代碼或解釋, – 2009-04-23 15:35:12