0
Chromeで完全に機能する次のコードがあります。New
をクリックすると、ポップアップが開き、Change
をクリックすると別のページにリダイレクトされます。IEでwindow.open()のリダイレクトが機能しない
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
</head>
<body ng-controller="contentCtrl">
<button ng-click="openNew()">New</button>
<button ng-click="change()">Change</button>
<script>
var app = angular.module('plunker', []);
app.controller('contentCtrl', ['$scope', function ($scope) {
$scope.openNew = function() {
$scope.popup = window.open("https://www.stackoverflow.com", "popup", "status=1, location=1");
}
$scope.change = function() {
// $scope.popup = window.open("https://www.sina.com", "popup", "status=1, location=1");
// $scope.popup.location.assign("https://www.sina.com")
// $scope.popup.location.href("https://www.sina.com")
// $scope.popup.location = "https://www.sina.com"
$scope.popup.location.href = "https://www.sina.com"
}
}]);
</script>
</body>
</html>
しかし、このコードは、私はIEでのリダイレクトのいくつかの方法を示していますthis threadを発見したIE 11では動作しません、私はそれらのどれも働いていないなど、location.href(...)
、location.assign(...)
を試してみました。
IEでwindow.openのリダイレクトを達成する方法を知っている人はいますか?
素晴らしい!それは動作します:https://plnkr.co/edit/dWT0kBNHSNgq134C6Sd4?p=preview – Thomas
聞いて幸い;) – nitobuendia