我在用户通过AngularJS表单提交信息后尝试在新标签/页面中打开一个窗口。但是,Chrome的弹出窗口拦截器阻止了此操作。
这是我$http
app.js
个请求部分
// function to process the form
$scope.processForm = function() {
$http({
method : 'POST',
url : 'docusign.php', // PHP script generates URL from form data
data : $scope.user // pass in data as strings
})
.success(function(data) {
window.open(data); // this gets prevented by Chrome's popup blocker
//The root of the new page I'm trying to open is https://www.docusign.net
// -- Am I getting a pop-up block because I'm trying to take the user to a
// different website?
});
};
答案 0 :(得分:-1)
// function to process the form
$scope.processForm = function() {
$http({
method : 'POST',
url : 'docusign.php', // PHP script generates URL from form data
data : $scope.user, // pass in data as strings
async : false
})
.success(function(data) {
window.open(data, '_blank'); // this gets prevented by Chrome's popup blocker
});
};