<!DOCTYPE html><html ng-app="myApp"><head><meta charset="UTF-8"> <title>Document</title> <script src="js/angular.min.js"></script>
<script src="js/angular-route.min2.js"></script></head><body><div nav><a href="#/">首页</a> <a href="#/book">游戏</a> <a href="#/game">游戏</a></div><div ng-view=''> 我是内容 </div></div></body><script>var app=angular.module('myApp',['ngRoute']) .config(function($routeProvider){ $routeProvider
.when('/',{template:'首页1'}) .when('/book/',{templateUrl:'view/b.html'}) .when('/game/',{templateUrl:'view/c.html'})
.otherwise({ redirecTo:'/' }) })</script></html>会出错angular.min.js:79 XMLHttpRequest cannot load file:///D:/angular/item/view/b.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.怎么解决
添加回答
举报
0/150
提交
取消