在线等待,真的着急!!!就是问问大家给个说法!!!变量传递问题!!!这样好么??? ASP版的没太多人关注

NIRVANAIII 2004-07-19 10:31:39
做数字档案系统!!!


当前页面上有37项要提交的,我没用Form,因为不能用!


然后,到了提交时,我自己用JScript来以地址+变量的形式提交到一个Asp接受页面上!

想问一下这样好么?在一个地址里跟上37个变量稳妥么?
而且,37个变量的赋值里有中文、数字、英文,真的有点担心!

有过经验的给指个方向!
小弟感恩涕零——————


必复开贴唯以重分为报!!!
...全文
191 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
xishanlang2001 2004-07-19
  • 打赏
  • 举报
回复
我的方法不可以吗?
Laone 2004-07-19
  • 打赏
  • 举报
回复
没有form就用xmlhttp模拟form
sunjiujiu 2004-07-19
  • 打赏
  • 举报
回复
URL带的值的长度肯定是有限制的
建议你从实现方面换个其它的思路来用form,这样稳妥啊

对了,不知道哪位知不知道,asp能不能支持自定义个结构啊,如果可以,传个结构应该就没有问题了,呵呵
LxcJie 2004-07-19
  • 打赏
  • 举报
回复
如果form提交方式使用get方法的话,就是用url提交,跟你这个是一样的

如果使用post方式提交方式,则会封装一个数据包提交,这个时候,对大小是没有任何限制的,再者,http本来就是使用form向后台提交数据的
NIRVANAIII 2004-07-19
  • 打赏
  • 举报
回复
我看用Form其实也是在地址栏里跟了一大堆的变量,难道这和自己用JS写的URL+变量有区别么?


为什么Form要好,到底他稳定在那里了?
给讲讲这个…………

谢谢
LxcJie 2004-07-19
  • 打赏
  • 举报
回复
url带值的长度是有限制一般为1024个字节
xishanlang2001 2004-07-19
  • 打赏
  • 举报
回复
如果是在原窗口提交,那就新开一个大小和位置都相同的窗口,然后用window.opener.close() 关闭父窗口就可以了.
NIRVANAIII 2004-07-19
  • 打赏
  • 举报
回复
我只是想知道,会不会丢了一些东西…………

特殊字符的没有


url带值的长度是有限制的,那是多少?
Dlandiao 2004-07-19
  • 打赏
  • 举报
回复
URL参数传之前escape()一下
xishanlang2001 2004-07-19
  • 打赏
  • 举报
回复
父窗口:aaa.htm
----------------------
<input type=text id="xxx"><input type=text id="xxx"><input type=text id="xxx"><input type=text id="xxx"><input

type=text id="xxx">

<script>

function ccc()
{
var str=new Array()
for(var i=0;i<xxx.length;i++)
{
str[i]=xxx[i].value
}
return str;
}
</script>



<div onclick="window.open('bbb.htm')">sdf</div>

---------------------------------

子窗口:bbb.htm
---------------------------------
<html>
<body onload="dateArray=window.opener.ccc()">
<div onclick="alert(dateArray[0])">sdfsdf</div>
</body>
</html>
LxcJie 2004-07-19
  • 打赏
  • 举报
回复
对于特殊字符,可以替换为utf-8编码

/**
* encode the url
* usage:
* var str = "helloWorld&100%";
* str = str.replaceURL();
* //now the value of str is "helloWorld%26100%25"
*/
String.prototype.replaceURL = function()
{
var str = this;
str = str.replace(/%/g,"%25");
str = str.replace(/&/g,"%26");
str = str.replace(/=/g,"%3d");
str = str.replace(/#/g,"%23");
return str;
}
LxcJie 2004-07-19
  • 打赏
  • 举报
回复
为什么不能用form?url带值的长度是有限制的
xishanlang2001 2004-07-19
  • 打赏
  • 举报
回复
必然是不稳妥的.如果有特殊字符就传不过去了.
xishanlang2001 2004-07-19
  • 打赏
  • 举报
回复
刚发现,我的帖子怎么需要向下拉才看的到?:(
再贴一次.

父窗口:aaa.htm
----------------------
<input type=text id="xxx"><input type=text id="xxx"><input type=text id="xxx"><input type=text id="xxx"><input

type=text id="xxx">

<script>

function ccc()
{
var str=new Array()
for(var i=0;i<xxx.length;i++)
{
str[i]=xxx[i].value
}
return str;
}
</script>



<div onclick="window.open('bbb.htm')">sdf</div>

---------------------------------

子窗口:bbb.htm
---------------------------------
<html>
<body onload="dateArray=window.opener.ccc()">
<div onclick="alert(dateArray[0])">sdfsdf</div>
</body>
</html>

87,916

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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