当链接包含“@”符号时,如何阻止浏览器转到邮箱。
<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");
}
}
当数据包含'@'符号时,它会转到我不想要的邮箱,我希望它到达我发送的页面
答案 0 :(得分:1)
请替换此:
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");
我正在获得一个完美的页面弹出窗口。没有邮件申请。使用我的电子邮件地址作为网址只会打开一个页面,告诉我找不到地址,因为电子邮件地址不是有效的网址。
如果要在新窗口中显示数据,则应执行以下操作:
// 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.
答案 1 :(得分:0)
删除 autolink =&#34; true &#34;在显示列标记 .......