| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 885 人关注过本帖
标题:求助:.asp文件中能不能同是包含javascript和vbscript函数???
只看楼主 加入收藏
happyhu
Rank: 1
等 级:新手上路
帖 子:292
专家分:0
注 册:2005-7-12
收藏
 问题点数:0 回复次数:8 
求助:.asp文件中能不能同是包含javascript和vbscript函数???
我的一个文件hetong.asp中,包含一个javascript和vbscript两个函数,但是只有javascript的能用,不知为什么??请大家帮忙看一下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript>
//this.Hd.style.display='none';
function selCar_Change(txt)
{
if(txt=="汽运,运费供方负担")
{
this.Hd.style.display="inline";
}
else
{
this.Hd.style.display="none";
}
}
</script>
<SCRIPT LANGUAGE=vbscript>
function addfile()
dim str
str="<table WIDTH='750' BORDER='1' ALIGN='center' CELLPADDING='5' CELLSPACING='0' BORDERCOLOR='#111111' STYLE='BORDER-COLLAPSE: collapse' height='70'><TR> <TD> <p align='center'>编号</p></TD><TD><div align='center'>批号</div></TD><TD><div align='center'>质量标示</div></TD><TD><div align='center'>产品名称</div></TD><TD><div align='center'>包数</div></TD><TD><div align='center'>重量</div></TD></TR>"
if not IsNumeric (window.form1.filenum.value) then window.form1.filenum.value =1
for i=1 to window.form1.filenum.value
str=str&"<tr><td align='center'>"&i&"</td><td align='center'><input name='zbsh1' type='hidden' id='zbsh1' size='6'> <input name='bsh1' type='text' id='bsh1' size='6' ></td>"
str=str&"<td align='center'><input name='zhl1' type='text' id='zhl1' size='8'></td>"
str=str&"<td align='center'><input name='dj1' type='text' id='dj1' size='10'></td>"
str=str&"<td align='center'><input name='je1' type='text' id='je1' size='10'></td>"
str=str&"<td align='center'><input name='chqfd1' type='text' id='chqfd1' size='10'></td></tr>"
next
window.uptd.innerHTML =str&"</table>"
end function
</SCRIPT>
<form NAME="form1" method="post" action="?action=saveform">
<p align="center" class="style1">棉花购销合同</p>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="ht">
<td width="39" height="25" nowrap>供方:</td>
<td width="221" height="25"><input name="gong" type="text" id="gong" value="淄博宏健棉麻有限责任公司" size="35"></td>
<td width="101" nowrap>合同编号:</td>
<td width="139">&nbsp;
</td>
</tr>
<tr class="ht">
<td height="25" nowrap>需方:</td>
<td height="25"><input name="xu" type="text" id="xu" size="35"></td>
<td nowrap>合同签订点:</td>
<td><input name="qdd" type="text" id="qdd" value="淄博" size="15"></td>
</tr>
<tr class="ht">
<td height="25" colspan="4"> <span class="ht"> 根据《合同法》及国家有关法律规定,为明确双方权利义务,经双方协商一致,订立以下条款共同遵守:<br>
1、产品名称、质量标识、批号、包数、计量单位、重量、单价、金额、重量允许超欠幅度如下:</span></td>
</tr>
<tr class="ht">
<td height="25" colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center">上传
<input name="filenum" class="tx2" value="1" size="4">
个图片文件  
<input type="button" name="Button" onClick="addfile" value="设 定">
</div></td>
</tr>
<tr>
<td><DIV ID="uptd"></DIV></td>
</tr>
</table></td>
</tr>
<tr class="ht">
<td height="25" colspan="4">4、运输方式及费用负担:<br>
<select name=tk4 id="tk4" onChange=selCar_Change(this.options[this.selectedIndex].value) >
<option value=汽运,运费需方负担 selected>汽运,运费需方负担</option>
<option value=汽运,运费供方负担 >汽运,运费供方负担</option>
</select>
<div id=Hd style="display:none" >
,单价 <input type=text name=yunfei size=5> 元/吨。
</div>
</td>
</tr>
</table>
<p align="center">
<input type="submit" name="Submit" value="提 交">
</p>
</form>
应该怎么改呢???谢谢!!!
搜索更多相关主题的帖子: vbscript javascript 函数 中能 
2006-03-23 10:47
ca2ju3
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2005-6-10
收藏
得分:0 

把VBSCRIPT的代码,移到JS的前面看看行不!

2006-03-23 11:23
happyhu
Rank: 1
等 级:新手上路
帖 子:292
专家分:0
注 册:2005-7-12
收藏
得分:0 
移到前面vbscript函数能用了,但javascript函数又不能用了。为什么呢??
难道两个函数只能用一个????
请教!!!!!

2006-03-23 15:10
happyhu
Rank: 1
等 级:新手上路
帖 子:292
专家分:0
注 册:2005-7-12
收藏
得分:0 

请大家帮忙啊,看看改怎么改?谢谢!!


2006-03-23 16:08
luchao
Rank: 1
等 级:新手上路
帖 子:110
专家分:0
注 册:2005-11-30
收藏
得分:0 
<input name="filenum" class="tx2" value="1" size="4">
个图片文件  
<input type="button" name="Button" onClick="addfile();" value="设 定">

2006-03-23 16:43
luchao
Rank: 1
等 级:新手上路
帖 子:110
专家分:0
注 册:2005-11-30
收藏
得分:0 


<script language=javascript>
//this.Hd.style.display='none';
function selCar_Change(txt)
{
if(txt=="汽运,运费供方负担")
{
this.Hd.style.display="inline";
}
else
{
this.Hd.style.display="none";
}
}
</script>

<script language="vbscript">
function Button_onclick()
dim str
str="<table WIDTH='750' BORDER='1' ALIGN='center' CELLPADDING='5' CELLSPACING='0' BORDERCOLOR='#111111' STYLE='BORDER-COLLAPSE: collapse' height='70'><TR> <TD> <p align='center'>编号</p></TD><TD><div align='center'>批号</div></TD><TD><div align='center'>质量标示</div></TD><TD><div align='center'>产品名称</div></TD><TD><div align='center'>包数</div></TD><TD><div align='center'>重量</div></TD></TR>"
if not IsNumeric (window.form1.filenum.value) then window.form1.filenum.value =1
for i=1 to window.form1.filenum.value
str=str&"<tr><td align='center'>"&i&"</td><td align='center'><input name='zbsh1' type='hidden' id='zbsh1' size='6'> <input name='bsh1' type='text' id='bsh1' size='6' ></td>"
str=str&"<td align='center'><input name='zhl1' type='text' id='zhl1' size='8'></td>"
str=str&"<td align='center'><input name='dj1' type='text' id='dj1' size='10'></td>"
str=str&"<td align='center'><input name='je1' type='text' id='je1' size='10'></td>"
str=str&"<td align='center'><input name='chqfd1' type='text' id='chqfd1' size='10'></td></tr>"
next
window.uptd.innerHTML =str&"</table>"
end function
</SCRIPT>

<form NAME="form1" method="post" action="">
<p align="center" class="style1">棉花购销合同</p>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="ht">
<td width="39" height="25" nowrap>供方:</td>
<td width="221" height="25"><input name="gong" type="text" id="gong" value="淄博宏健棉麻有限责任公司" size="35"></td>
<td width="101" nowrap>合同编号:</td>
<td width="139">&nbsp;
</td>
</tr>
<tr class="ht">
<td height="25" nowrap>需方:</td>
<td height="25"><input name="xu" type="text" id="xu" size="35"></td>
<td nowrap>合同签订点:</td>
<td><input name="qdd" type="text" id="qdd" value="淄博" size="15"></td>
</tr>
<tr class="ht">
<td height="25" colspan="4"> <span class="ht"> 根据《合同法》及国家有关法律规定,为明确双方权利义务,经双方协商一致,订立以下条款共同遵守:<br>
1、产品名称、质量标识、批号、包数、计量单位、重量、单价、金额、重量允许超欠幅度如下:</span></td>
</tr>
<tr class="ht">
<td height="25" colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center">上传
<input name="filenum" class="tx2" value="1" size="4">
个图片文件  
<input type="button" name="Button" value="设 定">
</div></td>
</tr>
<tr>
<td><DIV ID="uptd"></DIV></td>
</tr>
</table></td>
</tr>
<tr class="ht">
<td height="25" colspan="4">4、运输方式及费用负担:<br>
<select name="tk4" id="tk4" onChange="selCar_Change(this.options[this.selectedIndex].value)" >
<option value=汽运,运费需方负担 selected>汽运,运费需方负担</option>
<option value=汽运,运费供方负担 >汽运,运费供方负担</option>
</select>
<div id=Hd style="display:none" >
,单价 <input type=text name=yunfei size=5> 元/吨。
</div>
</td>
</tr>
</table>
<p align="center">
<input type="submit" name="Submit" value="提 交">
</p>
</form>


2006-03-23 18:18
luchao
Rank: 1
等 级:新手上路
帖 子:110
专家分:0
注 册:2005-11-30
收藏
得分:0 
这两个都可以,可是不知道为什么把VBScript 代码放到JS代码的前面就不可以了,郁闷啊

2006-03-23 18:20
happyhu
Rank: 1
等 级:新手上路
帖 子:292
专家分:0
注 册:2005-7-12
收藏
得分:0 
是不是JS函数和VBScript不能同是用啊?有没有朋友遇到过类似的问题,请指教。谢谢!!!

2006-03-24 08:05
happyhu
Rank: 1
等 级:新手上路
帖 子:292
专家分:0
注 册:2005-7-12
收藏
得分:0 
谢谢“luchao”朋友!
但不知到为什么JS函数和VBScript不能同时用啊?

2006-03-24 08:11
快速回复:求助:.asp文件中能不能同是包含javascript和vbscript函数???
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017011 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved