当前位置:首页 > ASP教程 > 应用技巧

asp下用fso生成js文件的代码

<%sub fsojs()%>
 <%
set fso= server.createobject("scripting.filesystemobject")
set fd=fso.createtextfile(server.mappath("../category.js"),true)

'开始操作
set rs=server.createobject("adodb.recordset")
rs.open "select * from dept_category",conn,1,1
str="var onecount;"&vbcrlf&"onecount=0;"&vbcrlf&"subcat = new array();"

for i=1 to rs.recordcount
str=str&vbcrlf&"subcat["&(i-1)&"] = new array('"&rs("category")&"','"&rs("parentid")&"','"&rs("categoryid")&"');"
rs.movenext
next
str=str&vbcrlf&" onecount="&rs.recordcount&";"&vbcrlf
fd.writeline str

%>
<%end sub%>

【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!

相关教程推荐

其他课程推荐