繁体   English   中英

点击一个

[英]click an <a href using javascript function

我有这个JS和HTML代码:

<div id="EditPage" class="EditPagePopup">
    <div class="EditPagePopupWrapper">
    <iframe id="EditPageFrame" width="100%" height="75%" src=""></iframe>
    <div id="JQueryPopupRight"><a id="JQueryRefreshIframe">&#x21bb;</a> <a id="JQueryClose">&#215;</a></div>
    </div>
</div>

$(document).ready(function(){
    $("a#MiniPopupWindow").click(function (e) {
        e.preventDefault();
        //On click, open the page (<a value> value) in the above iframe/popup window
        $("#EditPageFrame").attr("src", $(this).attr("value"));
        $("a").removeClass("active");
        $(this).addClass("active");

        JQueryPopup('#EditPage');
    });

    $("a#JQueryRefreshIframe").click(function (e) {
        document.getElementById('EditPageFrame').contentWindow.location.reload(true);
    });
});

然后我有一个href链接,如:

<a id="MiniPopupWindow" value="http://www.google.co.uk/">test</a>

这将打开一个包含iframe的弹出div,并将iframe的SRC设置为href项目的值

我在使用javascript的另一页上有一个函数:

function VoIP_Portal() {
    window.location = "/voip_portal";
}

如何在iframe中使用带有SRC的功能打开弹出窗口?

<a id="MiniPopupWindow" href="http://www.google.co.uk/">test</a> ??

window.location = "/voip_portal"; 

nedd href

window.location.href = "/voip_portal";

您可以使用cookie来实现它。 如果可以在服务器端处理您的请求,它将变得更加容易,您可以将所需的参数发送到服务器并从那里服务您的页面。

如果您只想使用JavaScript来解决它,那么可以研究一下该解决方案。 使用JavaScript将值从一页传递到另一页

问候,HBK

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM