function reurl()
    {
     var a=test();
     var b='./project.do?method=delete&billno='+a;
    // alert(b);
     return b;
    }                   <input type="button" value="删除" style="width:50px; height:40px;" onclick="javascript:window.open('<script>reurl()</script>','_self')"/>
为什么我在下面调用不到 js函数的路径。  请各位帮帮忙

解决方案 »

  1.   

    应该是路径问题吧。下面这段有没加?
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">或者var b='request.getContextPath()/...../project.do?method=delete&billno='+a;直接写成绝对路径
      

  2.   

    window.open('reurl()','_self')
    onclick="javascript:if(confirm('確定刪除此筆資訊信息嗎﹖'));else return false;window.location='Del_user.jsp'" 
      

  3.   

    用firebug调试一下就知道了,可能是你某代码语法错误导, 可能原因:1 text方法是否存在,2 open方法中好像不要<script></script>,你可以尝试将open方法写到reurl方法中,代码的可读信也增强了...
      

  4.   

    function reurl()
        {
         var a=test();
         var b='<%=basePath%>/project.do?method=delete&billno='+a;
        // alert(b);
         return b;
        }加上basepath试试
      

  5.   

    function reurl()
        {
         var a=test();
         var b='./project.do?method=delete&billno='+a;
        // alert(b);
         return b;
        }var a = test(); 这是什么function,有吗?
      

  6.   


    如果不行就是你reurl方法有错,try catch捕获下看看。
      

  7.   


    onclick="reurl()" 和这样不是一个意思么。
      

  8.   

    这个试试
    onclick="window.open('<script>javascript:reurl()</script>','_self')" 
      

  9.   

    window.open('reurl()','_self')不需要加 script