概述
这是一个简单的路由跳转,希望对你有所帮助
下面的连接中有复杂的路由跳转
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="angular1.4.6.min.js"></script> <script src="angular-route.js"></script> </head> <body ng-app="MyApp" > <a href="#/" rel="external nofollow" >CHINA</a><br/> <a href="#/1" rel="external nofollow" >CHINA1</a><br/> <a href="#/2" rel="external nofollow" >CHINA2</a><br/> <a href="#/3" rel="external nofollow" >CHINA3</a><br/> <div ng-view> 11111 </div> <script> var app = angular.module("MyApp", ["ngRoute"]); app.config(function ( $routeProvider) { $routeProvider .when("/", {template: "<h1>123</h1>"}) .when("/1", {template: "<h1>111</h1>"}) .when("/2", {template: "<h1>222</h1>"}) .when("/3", {template: "<h1>333</h1>"}); }); </script> </body> </html>
总结
以上所述是小编给大家介绍的JS路由跳转的简单实现代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
最后
以上就是无辜彩虹为你收集整理的JS路由跳转的简单实现代码的全部内容,希望文章能够帮你解决JS路由跳转的简单实现代码所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复