onClick="window.location.href='./';"  点击,跳转到首页。

location.href=url Js中实现跳转

window.location.href跳转新窗口

 window.location.href="http://cwhois.cnnic.cn/validatecode/validate.jsp?value="+strName+"&entity=domain&service=/whois&inputfield=value";

这段JS代码打开的是本页面
window.open("http://cwhois.cnnic.cn/validatecode/validate.jsp?value="+strName+"&entity=domain&service=/whois&inputfield=value);
�在在新创阔在新
在新窗口中打开

window.location方法获取URL
  统一资源定位符 (Uniform Resource Locator, URL)
完整的URL由这几个部分构成:
  scheme://host:port/path?query#fragment
scheme:通信协议
常用的http,ftp,maito等
host:主机
  服务器(计算机)域名系统 (DNS) 主机名或 IP 地址。
port:端口号
  整数,可选,省略时使用方案的默认端口,如http的默认端口为80。
path:路径
  由零或多个"/"符号隔开的字符串,一般用来表示主机上的一个目录或文件地址。
query:查询
  可选,用于给动态网页(如使用CGI、ISAPI、PHP/JSP/ASP/asp.net等技术制作的网页)传递参数,可有多个参数,用"&"符号隔开

  ,每个参数的名和值用"="符号隔开。
fragment:信息片断
  字符串,用于指定网络资源中的片断。例如一个网页中有多个名词解释,可使用fragment直接定位到某一名词解释。(也称为锚点.)
示例:
http://www.home.com:8080/windows/location/page.html?ver=1.0&id=timlq#love
1, window.location.href
整个URl字符串(在浏览器中就是完整的地址栏)
  返回值:http://www.home.com:8080/windows/location/page.html?ver=1.0&id=timlq#love
2,window.location.protocol  URL 的协议部分
  返回值:http:

3,window.location.host    URL 的主机部分,
  返回值:www.home.com
4,window.location.port    URL 的端口部分。如果采用默认的80端口(update:即使添加了:80),那么返回值并不是默认的80而是空字符。
  本例返回值:8080
5,window.location.pathname  URL 的路径部分(就是文件地址)
  返回值:/windows/location/page.html
6,window.location.search  查询(参数)部分。除了给动态语言赋值以外,我们同样可以给静态页面,并使用javascript来获得相信应的参数值
  返回值:?ver=1.0&id=timlq
7,window.location.hash    锚点
返回值:#love
方法:
1.window.location.reload()
刷新当前页面。

window.location.href问题,点击,跳转到首页的更多相关文章

  1. window.location.href/replace/reload()--页面跳转+替换+刷新

    一.最外层top跳转页面,适合用于iframe框架集 top.window.location.href("${pageContext.request.contextPath}/Login_g ...

  2. 5. window.location.href/replace/reload()--页面跳转+替换+刷新

    1.window.location=url; window.location 对象用于获得当前页面的地址 (URL),并把浏览器重定向到新的页面. 一.最外层top跳转页面,适合用于iframe框架集 ...

  3. window.location.href跳转问题

    任务中遇到这样一个问题,用window.location.href跳转一到个网址,但是每次都出错,显示网址前面加上了文件所在文件夹的路径 示例如下: window.location.href=&quo ...

  4. window.top.location.href 和 window.location.href 的区别

    window.location.href 是本页面跳转 window.top.location.href是最外层的页面跳转

  5. window.location.href = window.location.href 跳转无反应 a 超链接 onclick 点击跳转无反应

    错误写法 , 主要是在 href="#"这里 <a href="#" id="send" onclick="return b ...

  6. 遇到问题-----JS中设置window.location.href跳转无效(在a标签里或这form表单里)

    问题情况 JS中设置window.location.href跳转无效 代码如下: ? 1 2 3 4 5 6 7 8 <script type="text/javascript&quo ...

  7. IE6下window.location.href不跳转到相应url

    前天一同事遇到个看似很诡异的问题,就是<a href="javascript:void(0);" onclick="window.location.href=url ...

  8. springboot 中页面跳转问题:window.location.href

    我的一个HTML页面 点击注册 本该到注册页面,但是却一直跳到同目录的一个Error.html文件夹下 该页面: 删掉Error.html还不行:会报错,而且改变window.location.hre ...

  9. 微信内置的浏览器window.location.href 跳转不兼容问题

    1.不兼容苹果手机---->>>>使用模拟触发a标签 <a id="alink" href="http://www.baidu.com&qu ...

随机推荐

  1. 网络流(最大流):POJ 1149 PIGS

    PIGS Time Limit: 1000ms Memory Limit: 10000KB This problem will be judged on PKU. 64-bit integer(整数) ...

  2. bzoj 1089 [SCOI2003]严格n元树(DP+高精度)

    1089: [SCOI2003]严格n元树 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 1250  Solved: 621[Submit][Statu ...

  3. SPBF(队列优化的Bellman-Foord)

  4. 简单的FIRST+集演示程序

    /* * 该程序用于计算某个非终结符的 FIRST+ 集合 * RexfieldVon * 2013年6月30日16:02:47 */ #include <stdio.h> #includ ...

  5. viewWillLayoutSubView

    当viewController的bounds又改变,调用这个方法来实现subview的位置.可重写这个方法来实现父视图变化subview跟着变化.                   > Lif ...

  6. Selenium终极自动化测试环境搭建(一) Selenium+Eclipse+Junit+TestNG

    Selenium终极自动化测试环境搭建(一)Selenium+Eclipse+Junit+TestNG 第一步 安装JDK JDk1.7. 下载地址:http://www.oracle.com/tec ...

  7. serialVersionUID的作用以及设置方法(转)

    声明:本篇文章是转载的 http://blog.csdn.net/kakaxi_77/article/details/8129070 http://snowlotus.iteye.com/blog/2 ...

  8. 一些正则在js使用方法

    输入框直接正则判断 <input type="password" name="pwd" placeholder="密码只能以数字\英文\@\.& ...

  9. jquery ajaxform上传文件返回不提示信息的问题

    在使用jquery的ajaxform插件进行ajax提交表单并且上传文件的时候,返回类型datatype :json但是后台通过写出一个json对象后,在执行完以后没有进入success函数,而是直接 ...

  10. HDU 4622 多校第三场1002 后缀自动机

    比赛的时候我是用后缀数组的,但是T了. 赛后看了解题报告说,后缀数组貌似是卡你常数的时间,我算了下复杂度O(T * Q * n).这是10 ^ 8,但是考虑到每次询问的时候都要重新构造字符,所以那个n ...