ajax - getJSON() 方法
$("body").on("click",".layui-input-inline:eq(3)",function(){ $(this).find("dd").click(function(){ var examId = $(this).attr("lay-value"); if("0"!=examId){ var herf = "/exam_papers?exam_id="+examId; $.getJSON(herf, function(json) { var n = json.length; var html = "";for(var i=0;i<n;i++){var html = "<option value='"+ json[i].id +"'>"+json[i].title+"</option>"; $("#examPaperSelect").append(html); } }); } }); });
http://www.w3school.com.cn/jquery/ajax_getjson.asp