1
$("#radio5").click(function()
{
document.getElementById("ti").style.display="table";
$.ajax
({
type:"GET",
url:"inst.php",
dataType:"xml",
success: xmlInstructor
});
});
function xmlInstructor(xml)
{
$(xml).find('Instructor').each(function()
{
instructorName = $(this).find('InstructorName').text();
$("#ti").append("<tr><td>"+"<input type='button' id='instructorButton' onclick='i_click("+instructorName+")' value='ADD' />"+"</td><td>"+instructorName+"</td></tr>");
});
}
코드는 여기까지 제대로 작동합니다. 하지만 얻을 수없는 i_click 함수에서 instructorName에주의를 기울이고 싶습니다. 정수를 넘겨 주면 작동하지만 문자열은 그렇지 않습니다.jquery 함수가 경고 문자열이 아닙니다.
function i_click(instructorName)
{
alert(instructorName);
}
강사에게 알릴 수 없습니다.
고맙습니다 youuu !!!!!!!!!! – niketshah90