注册 登录
编程论坛 ASP技术论坛

script使用方法

guang2356447 发布于 2010-07-13 13:51, 750 次点击
怎么把下面这3行   写成可以调用的形式
<script type="text/javascript">
document.write(document.URL);
</script>


我是这样写并调用的
<script type="text/javascript">
function aa(){
document.write(document.URL);
}
</script>
调用 aa()  但是错误

高手帮帮
6 回复
#2
gupiao1752010-07-13 14:05
<script type="text/javascript">
function aa(){
document.write(document.URL);
}
aa();
</script>
提示什么错误?
#3
guang23564472010-07-13 14:21
提示语句未结束     18行

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
//不知道给这个有关系没  vbscript
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<script type="text/javascript">
function aa(){
document.write(document.URL);
}
</script>
<table width="192" height="52" border="1" cellpadding="0" cellspacing="0">
<%
aa();    //这个是18行
Set rss=Server.CreateObject("Adodb.RecordSet")
sql="select * from aa"
rss.Open sql,conn,1,1
do while not rss.eof
%>
<tr>
<td><%=rss("id")%></td>
<td><%=rss("name")%></td>
</tr>
<%
rss.movenext
loop
%>
</table>
</body>
</html>


[ 本帖最后由 guang2356447 于 2010-7-13 14:25 编辑 ]
#4
gupiao1752010-07-13 14:29
<script type="text/javascript">
function aa(){
document.write(document.URL);
}
aa();
</script>
JS和ASP语句别混淆了!

#5
loneeweb2010-07-15 00:55
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <script type="text/javascript">
    function aa()
    {
        document.write(document.URL);
    }
    </script>
    </head>
    <body onblur="aa();"></body>
</html>
#6
loneeweb2010-07-15 00:55
程序代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.">
<html xmlns="http://www.">
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <script type="text/javascript">
    function aa()
    {
        document.write(document.URL);
    }
    </script>
    </head>
    <body onblur="aa();"></body>
</html>
1