15.js(带有跳转的登陆注册)

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
        <script src="jquery.js"></script>
	</head>
	<body>
		用户名:<input id="username" placeholder="6-12位 首字母需大写"></br>
		密码:<input id="password" type="password" placeholder="6-12位"></br>
		<input type="submit" value="注册" onclick="tap()">
		<script>
			function tap(){
				username=document.getElementById("username").value.split("")
				password=document.getElementById("password").value.split("")
				cap=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
				if(username.length>5&&username.length<13&&password.length>5&&password.length<13){
					for(i=0;i<cap.length;++i){
						if(username[0]==cap[i]){
							alert("注册成功,前往登录")
							location="denglu.html?"+username+"#"+password
							break
						}else if(i==25){alert("注册失败")}
					}
				}else{alert("注册失败")}
			}
		</script>
	</body>
</html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
        <script src="jquery.js"></script>
	</head>
	<body>
		用户名:<input id="username" placeholder="请输入用户名:"></br>
		密码:<input id="password" type="password" placeholder="请输入密码:"></br>
		<input type="button" value="登录" onclick="tap()">
		<script>
			function tap(){
				if(location.search.split(",").join("")=="?"+document.getElementById("username").value&&location.hash.split(",").join("")=="#"+document.getElementById("password").value){
					alert("登陆成功")
				}else{alert("用户名或密码错误")}
			}
		</script>
	</body>
</html>

  • 2
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Vue.config.js不会直接影响路由跳转,它是用来配置Vue的全局配置项的。但是,通过配置Vue的全局配置项,可以影响到Vue Router的行为,从而间接影响路由跳转。例如,可以通过配置Vue.config.js中的publicPath选项来影响Vue Router中路由的base路径。 ### 回答2: vue.config.js 对路由跳转有一定的影响。 在 Vue 项目中,vue.config.js 是用来配置 Vue CLI 生成的项目的配置文件。在该文件中,可以通过配置不同的选项来影响项目的打包、部署和运行等方面。 具体到路由跳转,vue.config.js 可以通过配置 baseUrl 或者 publicPath 等选项来影响前端路由的路径。默认情况下,Vue Router 默认使用的是 hash 模式,在访问路由时 URL 地址会带上 # 符号后面的部分,类似于 http://example.com/#/home。 如果我们想去除 URL 中的 # 符号,可以在 vue.config.js 中配置 publicPath 选项为 '/',然后在 Vue Router 的配置中设置 mode 为 'history',这样就可以启用 history 模式。在 history 模式下,路由跳转时 URL 地址就没有 # 符号了,类似于 http://example.com/home。 另外,vue.config.js 还可以通过配置 devServer.proxy 选项来处理跨域问题,例如将请求代理到其他的 API 服务器上,以解决前端开发过程中的跨域请求问题。 总结来说,vue.config.js 可以通过配置选项来影响前端路由的跳转,包括路径的显示方式和处理跨域请求等。但对于路由的具体实现和功能,还是需要在 Vue Router 的配置中进行相应的设置。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值