如何避免当数据包含'@'登录显示标签的链接

How to avoid from going to mail box when the data contains '@' sign in href link of display tag

本文关键字:显示 标签 链接 登录 何避免 数据包      更新时间:2023-09-26

如何在链接中包含" @ "符号时阻止浏览器跳转到邮箱

<display:column class="aligncenter" style="font-style: italic;"
                        property="conditions" sortable="true" title="Terms & Conditions"
                        autolink="true" href="javascript: openWindow('#')" paramId="pid"
                        paramProperty="pid">
                    </display:column>
function openWindow(pid) {
    pid = pid.substring(0, pid.length - 1);
    var url = "conditionpopup" + pid;
    var a = navigator.appName;
    if (a == "Netscape" || a == "Crome") {
        var w = screen.width / 2.3;
        var h = screen.height / 1.3;
        var left = (screen.width / 2) - (w / 2);
        var top = (screen.height / 2) - (h / 2);
        window.open(url, 'condtionpopup', "width=" + w + ", height=" + h
                + ", top=" + top + ", left=" + left
                + ", resizable=no, titlebar=0,dialog=yes,location=no");
    } else {
        var w = screen.width / 2.3;
        var h = screen.height / 1.5;
        var left = (screen.width / 2) - (w / 2);
        var top = (screen.height / 2) - (h / 2);
        window.open(url, 'condtionpopup', "width=" + w + ", height=" + h
                + ", top=" + top + ", left=" + left
                + ", resizable=no, titlebar=0,dialog=yes,location=no");
    }
}

当数据包含'@'符号时它会进入我不想要的邮箱我想让它进入我要发送的页面

请替换这个:

if (a == "Netscape" || a == "Crome") {
    var w = screen.width / 2.3;
    var h = screen.height / 1.3;
    var left = (screen.width / 2) - (w / 2);
    var top = (screen.height / 2) - (h / 2);
    window.open(url, 'condtionpopup', "width=" + w + ", height=" + h
            + ", top=" + top + ", left=" + left
            + ", resizable=no, titlebar=0,dialog=yes,location=no");
} else {
    var w = screen.width / 2.3;
    var h = screen.height / 1.5;
    var left = (screen.width / 2) - (w / 2);
    var top = (screen.height / 2) - (h / 2);
    window.open(url, 'condtionpopup', "width=" + w + ", height=" + h
            + ", top=" + top + ", left=" + left
            + ", resizable=no, titlebar=0,dialog=yes,location=no");
}
与这个:

var h = screen.height / 1.5;
if (a == "Netscape" || a == "Crome") {
    var h = screen.height / 1.3;
}
var w = screen.width / 2.3;
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
window.open(url, 'condtionpopup', "width=" + w + ", height=" + h
        + ", top=" + top + ", left=" + left
        + ", resizable=no, titlebar=0,dialog=yes,location=no");

编程时不要重复。

现在,使用这个:

window.open('http://www.google.nl#@test', 'condtionpopup', "width=" + 500 + ", height=" + 500
        + ", top=" + 50 + ", left=" + 50
        + ", resizable=no, titlebar=0,dialog=yes,location=no");

我得到一个完美的页面弹出。没有邮件应用程序。使用我的电子邮件地址作为url只是打开一个页面,告诉我地址没有找到,因为电子邮件地址不是一个有效的url。

如果你想在新窗口中显示你的数据,你应该这样做:

// Open a blank page
myWindow = window.open('', 'condtionpopup', "width=" + w + ", height=" + h
        + ", top=" + top + ", left=" + left
        + ", resizable=no, titlebar=0,dialog=yes,location=no");
myWindow.document.write(url);
// Write your url (or other data) to this page.

删除 autolink ="真正的"在 .......