在javascript中查询字符串? [英] query string in javascript?
本文介绍了在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;
以下基于链接..
http://javascript.about.com/library/blqs.htm
http://ilovethecode.com/Javascript/Javascript-Tutorials-How_To-Easy/Get_Query_String_Using_Javascript.shtml
follow below link based..
http://javascript.about.com/library/blqs.htm
http://ilovethecode.com/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 = 'http://www.yourdomain.com'; // 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中查询字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文