2
아이콘을 클릭하려고하면 클릭 한 항목과 관련된 메시지를 표시하는 jQuery 대화 상자를 트리거합니다. jQuery에 익숙하지 않기 때문에 저는 운이 전혀 없습니다. 누군가 내가 뭘 잘못하고 있는지 말해 줄 수 있습니까? ASP를 MVC보기jQuery 대화 상자에서 onlcik을 실행하십시오.
<td>
@if (!String.IsNullOrWhiteSpace(item.Notes))
{
<span id="notes" onclick='GetNotes(@id);'>
<img src="@Url.Content("~/Content/images/magnify.gif")" alt="Show Notes" />
</span>
}
<div id="@id" style="display:none;">
@Html.DisplayFor(modelItem => item.Notes)
</div>
</td>
jQuery 코드에서 코드의
섹션 :
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script src="@Url.Content("~/Scripts/jquery.tablesorter.min.js")" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#thetable").tablesorter();
}
);
function GetNotes(id) {
$(function GetNotes() {
$("#" + id + "\"").dialog();
});
}
</script>
편집
는 onlick 메소드 이름은 이전에 오류가 포함되어 있습니다. 추가 ')'가있었습니다.
고맙습니다! 나는 또한 onlick 전화 오타 이온했다. 추가 ')'가 있습니다 – NealR
예, 처음에는 알지 못했습니다. js 콘솔을보십시오. 그것은 모든 것을 알려줍니다. –