1
我使用J-Query Mobile
和AngularJS
,並且在我要導航用戶到不同頁面的按壓鏈接上導航,但地址欄中的url地址不會更改如何解決此問題。我是個使用單頁結構以編程方式瀏覽頁面,但地址欄URL不更改
HTML部分
<a href="" ng-controller="addFoodToLog" ng-click="go()" data-role="button">Add To Log</a>
JS部分
var myApp = angular.module('myApp',[]);
myApp.controller('addFoodToLog',function($scope){
$scope.go = function() {
//Here Selected Food Bump In Food Log
alert("Successfully Add In Your Log");
$.mobile.changePage('index.html#foodscreen');
}
});
有人問它
之前http://stackoverflow.com/questions/7824243/jquery-mobile-mvc-getting-the-browser-url-to-change-with-redirecttoaction 你必須禁用移動阿賈克斯。看鏈接。 – Dvir
其中我禁用移動阿賈克斯 – Blu
@Dvir 我補充說,但沒有效果 Add To Log – Blu