下面这段程序,是在一本书上看到的,运行时点按钮没反应
<html>
<head>
<title>
按钮事件
</title><style>
<!--
.a{
position:absolute;
left:150;
color:yellow;
weight:bold;
font-family:arial;
text-transform:capitalize
  }#d1{
top:100
   }#d2{
top:140
   }#d3{
top:340
   }
-->
</style><script language = vbs>dim dic,x,x1
<% set dic = Server.CreateObject("Scripting.Dictionary")
dic.add "life","a kind of enjoyment"
dic.add "study", "a happy life"
dic.add "money", "a thing that must be pressed for"%>sub find_click()
  document.fm.ext.value = ""
  x = document.fm.tt.value for each word in dic
if word = x then
document.ext.value = cstr(dic.item(x))
end if
next if len(cstr(document.fm.ext.value)) = 0 then
document.fm.ext.value = "sorry, can not find the word you want." & "<br>" "if you want to add it to dictionary please click 'add'."
end if
end subsub add_click()
x1 = document.fm.ext.value
x2 = document.fm.tt.value
dic.add x1,x2
end sub
</script></head><body bgcolor = "#6699dd">
<center>
<h2 class = "a"> 词典 </h2><br><form name = "fm">
<div class = "a" id = "d1">
INPUT <input type = "text" name = "tt" style = "width:300; height:30">
</div> <div class = "a" id = "d2">
<input type = "text" name = "ext" style = "width:360; height:180; overflow:scroll">
</div> <div class = "a" id = "d3">
<input type = "Button" value = "查找" name = "find" onclick = "find_click" style = "width:105;height:30;bgcolor:#6699dd">&nbsp&nbsp&nbsp
<input type = "Button" value = "添加" name = "add" onclick = "add_click"  style = "width:105;height:30;bgcolor:#6699dd">&nbsp&nbsp&nbsp
</div>
</form>
</body>
</html>

解决方案 »

  1.   

    发错地方了吧,这里是vc,mfc,不是vb
      

  2.   

    这里是VC/MFC,不是HTML/script编程
      

  3.   

    VC的也应该懂一些脚本,否则怎么做Web接口,呵呵。  在find_click函数里面加一个弹出对话框的代码,javascript是alert,vbscript就不知道了。
      

  4.   

    谢谢疯子头儿, 我加过,没执行到到里面,而且好像是哪个Directory的事,把它去掉就好了另 那位知道怎么转贴吗,我看这里有个html/xml区就把帖子贴到这了,看来是贴错地方了
      

  5.   

    <%    set dic = Server.CreateObject("Scripting.Dictionary")似乎ASP的东西