class topicmodel
public onview
public function load(id)
if not(isevent(onview)) then
onview(1)
end if
end function
function isevent(evnet)
isevent = isempty(evnet)
end function
end class
sub updateviewcounter(value)
response.write("counter add "& value &" .")
end sub
dim topic : set topic = new topicmodel
set topic.onview = getref("updateviewcounter")
topic.load(1)
%>
差点把 getref 这个函数忘记了 今天刚好看到
写了个简单示例 有兴趣的可以在自己的项目上应用下
不过 vbs 的事件弱了点 最实际的好处其实是可以动态调用过程或函数