怎么调用javascript的函数, 哎,连这个问题我都不会
<script language= "javascript ">
function GetArgsFromHref(sHref, sArgName)
{
var args = sHref.split( "? ");
var retval = " ";
....................
..............
return retval;
}
</script>
.........
..........
<td align= "center " width= "200 "> 用户名: <%= javascript:GetArgsFromHref(window.location.href, "UserName ") %> </td>
是想把用户名通过window.location.href的参数传过来,
参数是没有问题了,
怎么运行时显示不来鄂,
是不是 <%= javascript:GetArgsFromHref(window.location.href, "UserName ") %> 这里写的不对啊,我以前没用过这个。
谢谢了
------解决方案--------------------不知道楼主写的什么意思, <%= javascript:GetArgsFromHref(window.location.href, "UserName ") %> 是ASP的执行的吗,JS是在客户端执行的.
------解决方案-------------------- <script language= "javascript ">
function GetArgsFromHref(sHref, sArgName)
{
var args = sHref.split( "? ");
var retval = " ";
....................
..............
return retval;
}
</script>
.........
..........
<td align= "center " width= "200 "> 用户名: <script language=javascript >
document.write(javascript:GetArgsFromHref(window.location.href, "UserName ")); </script> </td>
应该可以这样写出来。
具体的你自己试一下吧