嗨,我有一张图片,点击该图片会调用另一个 .aspx 页面,该页面作为 iframe 加载。我想单击 iframe 内的按钮,它会关闭 iframe。我尝试了不同的方法,但它们都不起作用:
这是我的 iframe:
function openBox() {
    $(".nodeOption, .nodeOptionBlack").fadeIn(200);
    var pageHeight = $(document).height();
    var pageWidth = $(document).width();
    $(".nodeOptionBlack").css("height", pageHeight).css("width", pageWidth);
}
$(document).ready(function() {
    $(".nodeOptionBlack").click(function () {
        $(".nodeOption, .nodeOptionBlack").fadeOut(200);
    });
    $(".WindowClose").click(function () {
        $(".nodeOption, .nodeOptionBlack").fadeOut(200);
    });
Here is my function of button click:
function Submit_Click() {
    var enroll = test();
    if (enroll == "sale") {
        a.Node(urlParams["parentid"], urlParams["placement"], 1, "Sale");
    }
    else {
        a.Node(urlParams["parentid"], urlParams["placement"], 1, "");
    }
//here i want to close my iframe 
}
i tried different things like:
  $("#nodeOption").remove();
  window.parent.closeIframe();
      //document.getElementById("nodeOption").parent.removeChild(iframe);
     //$('#nodeOption', top.document).dialog('close');
     // window.parent.closeIframe();
    //$(".nodeOption, .nodeOptionBlack").fadeOut(200);
function closeIframe() {
    alert("hi");
    var ifram = document.getElementById(".nodeOption");
    iframe.parent.removeChild(iframe);
}
请提出我做错了什么。谢谢!