ASP中如何调用js文件中的函数

magicblade magicblade 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
default.asp:
=======================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<%
response.write "<script language=javascript src=""script/test.js""></script>" + vbcrlf
%>
</HEAD>
<BODY>
<%
response.write "<script>" + vbcrlf
response.write "var o = new obj();" + vbcrlf
response.write "document.write(o.test.name);" + vbcrlf
response.write "</script>" + vbcrlf
%>
</BODY>
</HTML>
===============================


test.js
===============================
function test(recall)
{
this.recall = recall;
this.name = "";
this.value = "";

this.Initialize = function(name, value)
{
this.name = name;
this.value = value;
}
}

function obj()
{
this.name = "this is manager!"
this.test = new test(this);
this.test.Initialize("123456", "This is a test only!");
}
================================



问题:
为什么在asp生成的页面中没有任何信息??

急急急急急,在线等
...全文
评论 7
收藏 已收藏
分享
返回顶部
magicblade
JavaScript 87,984 成员 224,681 内容