Quantcast
Channel: CSDN博客推荐文章
Viewing all articles
Browse latest Browse all 35570

JS 中的特殊字符 跳转连接

$
0
0

在JS中一种实现跳转的方法

location.href = "login.php";//页面直接跳转到当前目录下的login.php页面

 

如你想以绝对路径书写跳转地址,出现特殊字符想 /   "  之类的,需要转义字符

//反斜杠

/"双引号

如要跳转到 http://localhost/EasyChatt/index.php 

你要这么写,后面是参数

var url = "http:\/\/localhost/EasyChatt/index.php?contactController/listMyContact/"+checkValue;
location.href = url;

作者:cHikerstruggle 发表于2013-4-22 12:14:18 原文链接
阅读:25 评论:0 查看评论

Viewing all articles
Browse latest Browse all 35570

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>