<?php
echo $_GET['action'];
?>
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script>
function gogo(){
location.href = '?action=login';
}
</script>
</head>
<body>
<input type="button" value="测试location.href" onclick="gogo()"/>
</body>
</html>

当前页面是http://localhost:8084/test.php

点击按钮后location.href = http://localhost:8084/test.php?action=login;

location.href = '?action=login'; 这种设置直接在当前页面加参数

关于location.href赋值的php用法的更多相关文章

  1. window.open和window.location.href的几种用法

    windows.open("URL","窗口名称","窗口外观设定"); <A href="javascript:windo ...

  2. js中location.href的用法

    Javascript中的location.href有很多种用法,主要如下: self.location.href="/url" 当前页面打开URL页面 ocation.href=& ...

  3. [转载]window.location.href的用法(动态输出跳转)

    无论在静态页面还是动态输出页面中window.location.href都是不错的用了跳转的实现方案   javascript中的location.href有很多种用法,主要如下. self.loca ...

  4. location.href用法总结

    javascript中的location.href有很多种用法,主要如下. self.location.href=”/url” 当前页面打开URL页面 location.href=”/url” 当前页 ...

  5. js location.href 的用法

    self.location.href="/url" 当前页面打开URL页面: this.location.href="/url" 当前页面打开URL页面: pa ...

  6. JS中 window.location 与window.location.href的区别

    疑惑:window.location='url'  与window.lcoation.href='url'效果一样,都会跳转到新页面,区别在哪?查得的资料如下: 1:window.location是页 ...

  7. 页面的URL分析----window.location.href

    window.location是页面的位置对象window.location.href是 location的一个属性值,并且它是location的默认属性. window.location直接赋值一个 ...

  8. *.location.href 用法:

    *.location.href 用法: top.location.href=”url”          在顶层页面打开url(跳出框架) self.location.href=”url”       ...

  9. location.href的用法

    *.location.href 用法: top.location.href=”url”          在顶层页面打开url(跳出框架) self.location.href=”url”       ...

随机推荐

  1. 20155239 2016-2017-2 《Java程序设计》第7周学习总结

    教材学习内容总结 1.了解Lambda语言 "Lambda 表达式"(lambda expression)是一个匿名函数,Lambda表达式基于数学中的λ演算得名,直接对应于其中的 ...

  2. TED #06# Questioning the universe

    Stephen Hawking: Questioning the universe 1. 第一段: There is nothing bigger or older than the universe ...

  3. bzoj1008 / P3197 [HNOI2008]越狱

    P3197 [HNOI2008]越狱 考虑所有状况:显然是$m^{n}$ 考虑所有不合法状况: 显然相邻两个数不相等 那么后面$n-1$个数就有$(m-1)^{n-1}$种取法 第一个数前面没有相邻的 ...

  4. ZOJ 3391 Haunted Graveyard(最短路负权回路)题解

    题意:好长...从(0,0)走到(w-1,h-1),墓碑不能走,走到传送门只能进去不能走到其他地方,经过传送门时间会变化w(可能为负),其他地方都能上下左右走.如果能无限返老还童输出Never,走不到 ...

  5. js的函数作用域

    1.js作用域 //在函数内部声明的变量,如果不加var,则自动变成window的成员//预处理:扫描代码,看到var或者函数就生效./*function f(){a = 8;//var a = 8; ...

  6. php 二维数组

    <?php // 一个二维数组 $cars=array ( array(,), array(,), array(,) ); ?>

  7. CentOS6.4_x86_120g__20160306.rar

    安装的镜像包: CentOS-6.4-i386-bin-DVD1to2(CentOS-6.4-i386-bin-DVD1.iso / CentOS-6.4-i386-bin-DVD2.iso) 1. ...

  8. Linux命令详解-type

    type命令用来显示指定命令的类型. 一个命令的类型可以是如下之一     alias     别名     keyword 关键字,Shell保留字     function 函数,Shell函数 ...

  9. js将 HTML 页面生成 PDF 并下载

    最近碰到个需求,需要把当前页面生成 pdf,并下载.弄了几天,自己整理整理,记录下来,我觉得应该会有人需要 :) 先来科普两个插件: html2Canvas 简介 我们可以直接在浏览器端使用html2 ...

  10. HDU 4826 (分类DP)

    Labyrinth Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...