javascript如何在不同网页之间实现价值传递 [英] javascript how to achieve value-passing between different web pages

查看:83
本文介绍了javascript如何在不同网页之间实现价值传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在asp.net开发中,javascript如何实现不同网页之间的价值传递.谢谢.

In asp.net development,javascript how to achieve value-passing between different web pages.Thank you.

推荐答案

我不确定我是否理解您的问题正确.
假设您要将值从一页传递到另一页,则可以查询字符串.
您可能会发现以下文章很有帮助
使用QueryString在页面之间传递变量 [获取JavaScript中的查询字符串值 [此处 [
I am not sure if i understood your question correctly.
Assuming that you want to pass values from one page to another, you can go for query strings.
You may find the below article helpful
Passing variables between pages using QueryString[^]

Get query string values in JavaScript[^]

More links here[^]


他像这样使用

hi use like this

<form name="myform" method="post" action="post.aspx">
<input name="user" value="peter"/>
<input value="cc" value="aus"/>
<a href="javascript:myform.submit()">Click</a>
<form>





function postwith (to,p) {
  var myForm = document.createElement("form");
  myForm.method="post" ;
  myForm.action = to ;
  for (var k in p) {
    var myInput = document.createElement("input") ;
    myInput.setAttribute("name", k) ;
    myInput.setAttribute("value", p[k]);
    myForm.appendChild(myInput) ;
  }
  document.body.appendChild(myForm) ;
  myForm.submit() ;
  document.body.removeChild(myForm) ;
}




更多信息:

http://mentaljetsam.wordpress.com/2008/06 /02/using-javascript-to-post-data-pages/ [




More Info:

http://mentaljetsam.wordpress.com/2008/06/02/using-javascript-to-post-data-between-pages/[^]

regards
sarva


通过Javascript,您将无法在页面之间传递值.您需要一些对象来存储可以在整个页面中共享的值.

在这种情况下,您可以使用QueryString在页面之间传递值,并可以使用javascript进行检索.

否则,您可以使用各种对象将值从一页传递到另一页.


--Amit
Through Javascript you will not be able to pass values between pages. You need some objects to store the values which can be shareable throughout the pages.

In this case you can use QueryString to pass the values between the pages and you can retrieve it using javascript.

Otherwise you can use various objects to pass the values from one page to another.


--Amit


这篇关于javascript如何在不同网页之间实现价值传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆