您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

JS路由跳转的简单实现代码

2026/2/7 10:53:04发布16次查看
本文给大家分享一个简单的js路由跳转功能,非常不错,对js感兴趣的朋友参考下吧,这是一个简单的js路由跳转,希望对你有所帮助!
下面的连接中有复杂的路由跳转!
<!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/> <p ng-view> 11111 </p> <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路由跳转的简单实现代码,希望对大家有所帮助!!
相关推荐:
javascript实现多重继承实例详解
javascript体验异步更好的解决办法分享
javascript匹配js中注释的正则表达式代码
以上就是js路由跳转的简单实现代码的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product