我的JSP页面中的Html代码显示错误

时间:2014-08-26 06:24:08

标签: html jsp

这是我在下面给出的html代码:

<td> <a href="javascript:confirmGo('Sure to delete this record?','deletedb.jsp?id="+jobid+"')">Delete</a></td>

它显示以下例外情况:

  Multiple annotations found at this line:
    - Invalid location of tag (td).
    - Invalid location of text (+) in tag 
     (<a>).
    - Invalid location of text (+"')") in 
     tag (<a>).
    - Undefined attribute name (jobid).

请帮我纠正。

1 个答案:

答案 0 :(得分:1)

这对我来说很好,经过测试here

<!DOCTYPE html>
<html>
    <script>
        var jobid = 23;

        function confirmGo(msg,url){
            alert(msg);
            alert(url);
        }
    </script>

<body>
    <td> <a href="javascript:confirmGo('Sure to delete this record?','deletedb.jsp?id='+jobid)">Delete</a></td>

</body>

</html>