HTML里如何包含ASP文件

sanshisong 2006-03-13 11:28:17
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>

<body>
<%
response.write("nihao")
%>
</body>

</html>
--------------COOL.ASP

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>nihao</title>
</head>

<body>


<p> 
<script language="javascript" src="cool.asp"></script>
</p>

</body>

</html>
-------------------nihao.html

怎么运行时并没有调用cool.asp输出nihao呢?
...全文
366 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
king2003 2006-03-13
  • 打赏
  • 举报
回复
晕,得是JAVASCRIPT的语法呀!document.write("你好")
sanshisong 2006-03-13
  • 打赏
  • 举报
回复
-_-! 谢谢大家,结帐! 人人有份,对的多分,捧场的朝阳有分
Only_D 2006-03-13
  • 打赏
  • 举报
回复
来晚了
什么都不能 2006-03-13
  • 打赏
  • 举报
回复
可以这样用
我做过用asp做的javascript脚本文件

// Document getSystemTime
function playSound()
{
document.getElementById("newLetter").insertAdjacentHTML("BeforeEnd","<span style=\"display:none\"><embed src=images/msg.wav width=\"0\" height=\"0\" autostart='-1'></span>");
}


function Ajax()
{
var ajax;
try{
ajax=new ActiveXObject("microsoft.XMLHTTP");
}
catch(e)
{
try{
ajax=new ActiveXObject("MSXML2.XMLHTTP");
}
catch(ee)
{
alert("初始化Ajax失败"+ee);
}
}
return ajax;
}


function initAjax()
{
var ajaxObj=Ajax();
ajaxObj.open("get","systemtime.asp",false,null,null);
ajaxObj.onreadystatechange=function(){
if(ajaxObj.status==200&&ajaxObj.readystate==4)
{

rt=ajaxObj.responseText;
sss=rt.split("@");
uu=sss[0].split("$");
pp=sss[1].split("$");
if(pp[0]=="time")
{
document.getElementById("newLetter").innerHTML= "<b>"+pp[1].substring(0,pp[1].lastIndexOf(":"))+"</b>";
}
else if(pp[0]=="message")
{
document.getElementById("newLetter").innerHTML="  您有新的短信,请<a class='mess' href='mess/show.asp?id="
+pp[1]+"' target='main'>[查收]<img src=\"images/pub.gif\" border=0 alt=\"查看短信\"></a>";

playSound();
}

if(uu[0]=="user")
{
uinfo=uu[1].split("^");
uip=uinfo[1];
uid=uinfo[0]
if(uid=="<%=session("username")%>"&&uip=="<%=session("ip")%>")
{
alert("由于您违反了本系统的有关规定,特此,请您离开!\n如果您有和问题,请和管理员联系");
top.location.reload("quit.asp?method=close");
}

}
if(sss[2]!=""&&sss[2].indexOf("<%=session("username")%>")<=0)
{
pu=sss[2].split("$");
var newxmlhttp=Ajax();
newxmlhttp.open("get","show2all/apu.asp?u=<%=session("username")%>",false,null,null);
newxmlhttp.send();
var nnw=window.open("show2all/showpub.html","_blank","Width=200,Height=150,top=824;left=824");
nnw.pub.innerHTML="<center><table height=\"54\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"+
"<tr>"+
"<td>author:"+pu[1]+"</td>"+
"</tr>"+
"<tr>"+
"<td height=\"70\" width=\"150\">"+pu[2]+"</td>"+
" </tr>"+
"<tr>"+
"<td>"+" Edit by "+pu[0]+"</td>"+
"</tr>"+
"</table></center>"

}
}
}
ajaxObj.send();
}
setInterval("initAjax();",10000);
csyu85 2006-03-13
  • 打赏
  • 举报
回复
ASP的好像不能这样调。
什么都不能 2006-03-13
  • 打赏
  • 举报
回复
楼上的<script>标签就不要了
他这个页面用<script>调用的
tufun 2006-03-13
  • 打赏
  • 举报
回复
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>

<body>
<%
response.write("<script>document.write(""nihao"")</script>;")
%>
</body>

</html>

什么都不能 2006-03-13
  • 打赏
  • 举报
回复
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>

<body>
<%
response.write("document.write(""nihao"");")
%>
</body>

</html>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧