关于html地址栏传递参数的问题

wangruicai 2009-12-12 04:17:37
function sure()
{
var MorFIndex = document.all.MorF.selectedIndex;
var MorFText = document.all.MorF.options[MorFIndex].text
var MorFValue = document.all.MorF.option[MorFIndex].value alert(MorFValue);
var MorFValue1=0;
alert(MorFValue1);

var brandIdIndex = document.all.brandId.selectedIndex;
var brandIdText = document.all.brandId.options[brandIdIndex].text;
var brandIdValue = document.all.brandId.options[brandIdIndex].value;
var brandIdValue1;

var priceIndex = document.all.price.selectedIndex;
var priceText = document.all.price.options[priceIndex].text;
var priceValue = document.all.price.options[priceIndex].value;
var priceValue1;


var styleIdIndex = document.all.brandId.selectedIndex;
var styleIdText = document.all.brandId.options[styleIdIndex].text;
var styleIdValue = document.all.brandId.options[styleIdIndex].value;
var styleIdValue1;

var lengthIndex = document.all.brandId.selectedIndex;
var lengthText = document.all.brandId.options[lengthIndex].text;
var lengthValue = document.all.brandId.options[lengthIndex].value;
var lengthValue1;
location.href="*.select?MorFValue1=MorFValue&brandIdValue=1&priceValue=1&styleIdValue=1&lengthValue=1";
}
地址栏传递参数不能用MorFValue1=MorFValue这样复制带给参数的吗?可是我输出MorFValue这个值是能得到的。而且如果我手动的给他们参数复制1,我的servlet也是可以接收到的,是不是语法不是这样写的呀?如果是有别的方法,求求高手给我解答。。跪求了
var brandIdIndex = document.all.brandId.selectedIndex;
var brandIdText = document.all.brandId.options[brandIdIndex].text;
var brandIdValue = document.all.brandId.options[brandIdIndex].value;
这三个是得到搜索所选择的值。。
...全文
249 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
阿非 2009-12-12
  • 打赏
  • 举报
回复
location.href=escape("*.select?MorFValue1="+MorFValue+"&brandIdValue=1&priceValue=1&styleIdValue=1&lengthValue=1");
wangruicai 2009-12-12
  • 打赏
  • 举报
回复
不会吧?我输出了很多次,都是null,如果直接给它赋值的话 可以输出来,但是如果MorFValue1=MorFValue这样赋值的话,输出来的就是null
阿非 2009-12-12
  • 打赏
  • 举报
回复
可以的

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧