# jquery-router **Repository Path**: ereddate2017/jquery-router ## Basic Information - **Project Name**: jquery-router - **Description**: 方便传统网站的路由开发,基于jquery - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-04-16 - **Last Updated**: 2022-10-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # jquery-router #### 介绍 方便传统网站的路由开发,基于jquery #### 软件架构 jquery #### 使用说明 目前支持正常页面跳转,未来将支持history跳转。 ``` let router = $.Router({ routes:{ HOME: { path: "index.html", meta: { title: "首页", }, }, ABOUTUS: { path: "aboutus.html", meta: { title: "关于我们", }, }, } }); router.config({ TEST:{ path:"test.html", meta:{ title:"test" } } }); router.ready(() => { //更新页面title ... }); router.go( "ABOUTUS", { //跳转页面后面的参数,如aboutus.html?random=030238403204320 random: (Math.random(100) + "").replace(/\./gim, ""), }, function(next, fail) { //跳转前的操作,next()开始跳转,fail()打印错误,不跳转 ... next(); ... fail(); } ); router.goBack(true); //true,保留表单内容后退 例如: router.ready(() => { router.config({ TEST: { path: "test.html", }, }); router.add("TEST", { path: "test.html", meta: { title: "test", }, }); router.go("ABOUTUS", {}, (next, fail) => { setTimeout(function() { next(); }, 2000); }); router.go("aboutus", {}, (next, fail) => { setTimeout(function() { next(); }, 2000); }); router.go("home"); }); ``` #### 参与贡献 1. 作者ereddate #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)