javascript一个简单的路由跳转
标签:
JavaScript
这是一个简单的路由跳转,希望对你有所帮助
下面的连接中有复杂的路由跳转
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="angular1.4.6.min.js"></script> <script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="angular-route.js"></script></head><body ng-app="MyApp" ><a href="#/">CHINA</a><br/><a href="#/1">CHINA1</a><br/><a href="#/2">CHINA2</a><br/><a href="#/3">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>
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦