2017-03-13 8 views
0

ユーザーがAngularJSフォームを通じて情報を送信した後、新しいタブ/ページでウィンドウを開こうとしています。ただし、Chromeのポップアップブロッカーによってその操作が妨げられています。

は、ここでは、URLの文字列でなければなりませんdata` 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? 
     }); 
}; 

答えて

-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 
     }); 
}; 
+0

それは同じポップアップブロックの問題の内容が何であるかを – user3183717

+0

を受け取る 'だけ –

+0

それが判明、私の中の私$http要求部ですこの呼び出しの非同期性のためです。http://stackoverflow.com/a/19279442/2840591 私はこの –

関連する問題