Home  >  Article  >  Web Front-end  >  求两个纯Html之间的传值示例_html/css_WEB-ITnose

求两个纯Html之间的传值示例_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:33:13947browse

求两个纯Html之间的传值示例,跪谢。


回复讨论(解决方案)

http://bbs.csdn.net/topics/390876430

function getQueryString(name) {    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");    var r = window.location.search.substr(1).match(reg);    if (r != null) return unescape(r[2]); return null;}

比如A网页有个TEXT标签,里面输入个HELLO,然后点击A网页的按钮,在B网页的TEXT标签显示刚才输入的HELLO

A


  
  



B

<script> <br /> document.getElementById('a').value=decodeURI(location.search.match(/(\?|&)a=([^&#]*)/)[2]) <br /></script>

A


  
  



B

<script> <br /> document.getElementById('a').value=decodeURI(location.search.match(/(\?|&)a=([^&#]*)/)[2]) <br /></script>
能否粗略地解释下?如要要传递的值包括中文,代码如何改
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn