0
我正在JQuery中編寫一個腳本,當您從通過AJAX引入的選擇框中選擇一個選項時,它會根據您的選擇從數據庫加載結果...不適用於JQuery的選擇框
我知道當你通過AJAX引入數據時,你必須使用.live()來使用事件,但是我似乎仍然會遇到問題。
任何想法:
$('#schoolselect').live('blur',function(){
school = $(this).val();
console.log(school);
$.ajax({
type: "POST",
url: "./script/moduleandcourse.php",
data: {school:school,type:choice},
dataType: "html",
success: function(result){
console.log(choice);
$('#module_section').html(result).fadeIn(500);
console.log('#' + choice + 'select');
}
})
});
$('#moduleselect').live(blur,function(){
console.log("Selection Made");
});
從AJAX initally返回的選擇框的ID是moduleselect。
任何幫助都會大大降低:D
這條線是壞的$( '#moduleselect')。住(模糊,()的函數,更改 「模糊」 – 2012-04-20 11:48:28
模糊在你的第二個方法,模糊是不加引號:) – mattytommo 2012-04-20 11:48:31
_not_ _working_什麼不管用? – 2012-04-20 11:48:41