2 페이지가 있습니다.Jquery 대화 상자 닫기가 작동하지 않습니다.
색인은 jquery가 정의 된 기능 정의가있는 앵커 태그가있는 하이퍼 링크를 포함합니다. 이 페이지에는 "용기"
크리크 기능()
대화 페이지 자체가 내가 대화 상자를 닫으려고하는 제 2 페이지입니다 .dialog 사용하여 dailog을 엽니 다라는 DIV하지만이 나던 작품을 포함 .
왜 이것이 작동하지 않는지 설명해 주시겠습니까?
====== DIALOG 페이지 FROM INDEX 페이지에서 코드 ===========
<script type="text/javascript">
$().ready(function() {
$("#LaunchModal").click(function() {
$.get(
"Home/RandomPopupView",
function (htmlResult) {
$("#RandomModal").remove(); //In case this is the second time they've requested the dialog.
$("#container").append(htmlResult);
$("#RandomModal").dialog();
}
);
return false; //To keep the default behavior of the anchor tag from occuring.
});
});
</script>
<a href="" id="LaunchModal">Launch Modal!</a>
<div id="container">
====== CODE ==== =======
<div id="RandomModal">
<script type="text/javascript">
$().ready(function() {
//TEST TRY TO CLOSE THE DIALOG DIV IMMEDIATELY FROM WITHINN THE DIV ITSELF
$("#RandomModal").dialog("close"); //CLOSE DOES NOT WORK
$("#submitModal").click(function() {
var SomeString = $("#SomeString").val()
$.post("/Home/RandomPopupViewPOST",
{
SomeString: SomeString
},
function (html) {
$("#RandomModal").empty();
$("#RandomModal").append(html);
});
});
});
</script>
</div>
==================================== ===