在javascript中查询字符串?

编程入门 行业动态 更新时间:2024-10-27 11:16:25
本文介绍了在javascript中查询字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好朋友, 我如何在Java脚本中查询字符串? 我想使用Java中的查询字符串将值从一页转移到另一页 我有3个文本框,我想使用Java脚本将这些值传输到另一页.

hello friends, how i can user query string in java script? i want to transfer value form one page to another page using query string in java i have 3 text box and i want transfer these value to another page using java script. how its can possible anybody have any sample code for plz reply me asap.

推荐答案

以下Javascript代码将满足您的要求: The following Javascript code will fulfill your requirement: var value1 = document.getElementById("textBox1").value; var value2 = document.getElementById("textBox2").value; var value3 = document.getElementById("textBox3").value; location.href = "AnotherPage.aspx?val1=" + value1 + "&val2=" + value2 + "&val3="+value3;

以下基于链接.. javascript.about/library/blqs.htm ilovethecode/Javascript/Javascript-Tutorials-How_To-Easy/Get_Query_String_Using_Javascript.shtml follow below link based.. javascript.about/library/blqs.htm ilovethecode/Javascript/Javascript-Tutorials-How_To-Easy/Get_Query_String_Using_Javascript.shtml

您可以像这样重定向到其他页面, You can redirect to a different page like this, function move() { window.location = 'www.yourdomain'; // At the end concat with parameters. }

您可以按以下方式在JS中获取文本框值,

You can get the textbox values in JS as follows,

document.getElementById(id).value

id是您的实际控件ID.

where id is your actual control id.

更多推荐

在javascript中查询字符串?

本文发布于:2023-10-22 08:44:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1517018.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   javascript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!