angular.js - angularjs實現點擊事件后,在firefox生效卻在360瀏覽器不起作用
問題描述
在學習angularjs的過程中,做了一個選擇區域的小練習實現后在不同瀏覽器居然無法實現功能
<h5 class='titright'>選擇區域:</h5><select name='addressid1' ng-model='query'> <option value='no'>請選擇</option> <option value='{{phone.provinceid}}' ng-repeat='phone in phones' ng-click='getcity()'>{{phone.province}}</option></select><select name='addressid2' ng-model='mycity' ng-show='num==’1’'> <option value='no'>請選擇</option> <option value='{{phone.cityid}}' ng-repeat='phone in city| filter:query' ng-click='getareas()'>{{phone.city}}</option></select><select name='addressid3' ng-show='num1==’1’'> <option value='no'>請選擇</option> <option value='{{phone.areaid}}' ng-repeat='phone in areas| filter:mycity' >{{phone.area}}</option></select>
這是js
var phonecatApp = angular.module(’phonecatApp’, []);phonecatApp.controller(’PhoneListCtrl’, [’$scope’, ’$http’, function($scope, $http) { $http.get(’json/map_provinces.json’).success(function(data) { $scope.phones = data; $scope.query='120000'; $scope.num=0; $scope.num1=0; }); $scope.getcity=function(){$http.get(’json/map_city.json’).success(function(data) {$scope.num=1;$scope.num1=0;$scope.city = data;$scope.mycity='no'; }); }; $scope.getareas=function(){$http.get(’json/map_areas.json’).success(function(data) {$scope.num1=1;$scope.areas = data;$scope.myareas='no'; }); }; //$scope.orderProp = ’age’;}]);
在360瀏覽器中
在firefox瀏覽器中
問題解答
回答1:在select中用Ng-change
回答2:是不是IE版本問題?只有Angular1.2-才支持IE8.
回答3:上下文交待不清楚,比如ng的版本,360當前是極速模式還是兼容模式,控制臺有無報錯等等1樓說的是對的,應該在<select>中使用ng-change指令
