页面之间跳转传值

页面之间传值:

a.html

<html>
 <head>
  <title> New Document </title>
    <script>
      function   to (){
        var  getval =document.getElementById("cc").value;
        document.location.href("b.html?cc="+getval);
      }
    </script>
 </head>
 <body>
  <input type="text" id ="cc" > <input type="button"  value="a"  onclick="to()" >
 </body>
</html>

b.html

<html>
 <head>
 <title> New Document </title>
 <script>
  var thisURL = document.URL;
  var  getval =thisURL.split(‘?‘)[1];
  var showval= getval.split("=")[1];
  function  showvalf(){
     alert(showval);
     document.getElementById(‘ee‘).value=showval;
  }
</script>
 </head>
 <body >
  <input type="text"  id ="ee" />
 </body>
</html>  
时间: 2024-07-31 16:14:18

页面之间跳转传值的相关文章

react-native页面之间的相互传值

react-native页面之间的相互传值 之前在自己学习react-native的时候,在页面跳转和传值问题上花了一段时间去网上搜索和查找资料,自己总结了两个方法.可以参考 https://blog.csdn.net/shb2058/article/details/80390468 和 https://blog.csdn.net/shb2058/article/details/80432014首先设置一个不带参数的页面跳转使用navigation切换路由方法: this.props.navig

Android Intent实现页面之间跳转

什么是IntentIntent可以理解为信使(意图)由Intent来协助完成Android各个组件之间的通讯Intent实现页面逐渐的跳转1.startActivity(inetnt)2.startActivityForResult(intent, requestCode); onAcitivtyResult(int requestCode, int resultCode, Intent data) setResult(resultCode, data); 先创建两个xml文件firstacti

js实现两个页面之间跳转参数传递

html在设计时,规定跳转地址后加"?"表示从此开始为跟随页面地址跳转的参数. 有时候,我们希望获得相应的跳转前页面里的内容,这时候我们就可以考虑将内容以参数形式放到地址中传过来,这里我建议将参数以变量形式传递. 代码案例如下: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>direct1.ht

HTML页面之间跳转与传值(JS代码)

跳转的方法如下: 方法一: window.location.href = "b.html"; 方法二(返回上一个页面,这个应该不算,先放在这): window.history.back(-1); 方法三: self.location = "b.html"; 方法四: top.location = "b.html"; 有关问题的思考: 第一,为什么给window.location和window.location.href赋值时一样的,都可以跳转?

Asp.net页面之间几种传值方法【示例】

1.Request.QueryString 在传值的页面(aspx.cs页面): Response.Redirect("QueryStringPage.aspx?Data=" + Server.UrlEncode(DataToSendTextBox.Text)); 在接收值的页面(.net前端页面): <%=Server.UrlDecode(Request.QueryString["Data"]) %> 2.HttpPost 在传值的页面(aspx页面)

SSM Controller 页面之间跳转 重定向,有参 无参问题

需求:spring MVC框架controller间跳转,需重定向.有几种情况:不带参数跳转,带参数拼接url形式跳转,带参数不拼接参数跳转,页面也能显示. (1)我在后台一个controller跳转到另一个controller,为什么有这种需求呢,是这样的.我有一个列表页面,然后我会进行新增操作,新增在后台完成之后我要跳转到列表页面,不需要传递参数,列表页面默认查询所有的.        方式一:使用ModelAndView        return new ModelAndView("re

ASP.NET 页面之间传值的几种方式

原文:http://www.cnblogs.com/wangjiming/archive/2017/01/18/6275854.html#!comments 详解每种方法 一.Request.QueryString 核心代码: protected void getQueryString_Click(object sender, EventArgs e) { string QueStr = Request.QueryString["name"]; Response.Write(QueSt

笔记(三) ASP.NET 页面之间传值的几种方式

ASP.NET 页面之间传递值得方式大致可以分为如下几种:Request.QueryString["name"],Request.Form("name"),Session,Cookie,Cache,Application,Server.Transfer,Database, HttpContext的Item属性,Files,DataBase等等. 一.Request.QueryString 核心代码: protected void getQueryString_Cli

【转】【ASP.NET MVC系列】浅谈ASP.NET 页面之间传值的几种方式

ASP.NET MVC系列文章 原文地址:https://www.cnblogs.com/wangjiming/p/6275854.html [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操作篇)(下) [04]浅谈ASP.NET框架 [05]浅谈ASP.NET MVC运行过程 [06]浅谈ASP.NET MVC 控制器 [07]浅谈ASP.NET MVC 路由 [08]浅谈AS