jQuery无法在下拉菜单中找到我的自定义属性我有一个类似的只有一行上面,它很好,但这不断给我一个未定义。jQuery找不到自定义属性
的jQuery
$('#admin_student_school_select').change('click',function(){
var school_student = $(this+':selected').attr('school_student');
$('#admin_student_content_details')
.html(ajax_load)
.load(loadUrl,"form_being_submitted=admin_page_list_student&school="+school_student);
});
HTML
<select id="admin_student_school_select">
<option>Select a School</option>
<option school_student="1">Riverside Community College</option>
<option school_student="2">Victor Valley College</option>
<option school_student="3">Cal State San Bernardino</option>
<option school_student="4">Craffton College</option>
<option school_student="5">San Bernardino Community</option>
</select>
Ajax调用作品背后的脚本。我回应了结果。
是什么'$(这+ ':选择')'评估为?在这种情况下,“this”不是DOM元素吗? – 2012-04-09 05:08:16
你能告诉我们哪个变量是“undefined”吗? – 2012-04-09 05:14:42
School_student。它找不到school_student属性值。 – Cjueden 2012-04-09 05:16:15