我曾尝试以下,以实现这一目标中打开一个新的浏览器标签:如何从一个jQuery回调
但是从内部呼叫window.open
时既不作品回电话。这里是我的代码
$.post('api', {
}, function() {
var win = window.open('target-file', '_blank');
win.focus();
});
我曾尝试以下,以实现这一目标中打开一个新的浏览器标签:如何从一个jQuery回调
但是从内部呼叫window.open
时既不作品回电话。这里是我的代码
$.post('api', {
}, function() {
var win = window.open('target-file', '_blank');
win.focus();
});
使用MySurfaceWindow = window.open("url","windowname","settings");
见下面的例子:
MySurfaceWindow = window.open('/DesktopModules/DMS/DMS.PatientEChart/Surface Pages/Surface6.aspx?SurfaceTooth=' + $("#lbl" + $(this).val()).text() + '&ProcedureID=0' + '&ColorD=I' + '', '', 'height=240,width=200,top=' + top + ',left=' + left + 'status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no');
试试这个:
$.post('api', {
}, function() {
window.open('target-file', '_blank');
});
号不起作用。谢谢回复 – coder9 2013-05-10 10:50:28
OU可以在此简单的jQuery snipplet添加到您的源
$(document).ready(function(){
$('a').each(function() {
var a = new RegExp('/' + window.location.host + '/');
if(!a.test(this.href)) {
$(this).click(function(event) {
event.preventDefault();
event.stopPropagation();
window.open(this.href, '_blank');
});
}
});
});
新窗口可以通过被阻挡的Web浏览器的新标签中打开每个外部链接弹出窗口阻止程序? – mariusnn 2013-05-10 10:12:47
可能的重复[为什么我不能打开一个新的窗口在我的jquery ajax回调?](http://stackoverflow.com/questions/2791047/why-cant-i-open-a-new-window-on- my-jquery-ajax-callback) – 2013-05-10 10:13:01