html - Javascript programming, function not defined error -
here code. sorry improper indentation.
<%@ page language="java" contenttype="text/html; charset=euc-kr" pageencoding="euc-kr"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <title>게시판</title> <script type="text/javascript" src="../js/jquery-1.5.2.min.js"></script> <script type="text/javascript" src="../js/jquery.cookie.js"></script> <script type="text/javascript" src="../js/addscript.js"></script> <script type="text/javascript" src="../js/jquery.popupwindow.js"></script> <script type="text/javascript" src="../js/infobee.common.js"></script> <script type="text/javascript"> var html = '<table width="100%" cellpadding="0" cellspacing="0" border="0">'; html += '<tr height="5"><td width="5"></td></tr>'; html += '<tr style="background:url('+'img/table_mid.gif'+') repeat-x; text-align:center;">'; html += '<td width="5"><img src="img/table_left.gif" width="5" height="30" /></td>'; html += '<td width="73">번호</td>'; html += '<td width="379">제목</td>'; html += '<td width="73">작성자</td>'; html += '<td width="164">작성일</td>'; html += '<td width="58">조회수</td>'; html += '<td width="7"><img src="img/table_right.gif" width="5" height="30" /></td>'; html += '</tr>'; var domaintext = getdomain(); function getdomain() { return "localhost:8080"; } function getforumrow() { var userid = "neogeoss"; var passwd = "1311"; //map<string, object> mymap = new hashmap<string, object>(); // var row = document.getelementbyid("1strow"); var params = "userid="+userid+"&userpassword="+passwd; $.ajax({ type: "get", url: "http://"+domaintext+"/secure_server/test/test.do", callback: "callback", datatype: "jsonp", data:params, success: function(data) { var htmlinner = html; $.each(data, function(k, v){ htmlinner += "<tr height='25' align='center'>" htmlinner += "<td> </td>"; htmlinner += "<td>"+v["num"]+"</td>"; htmlinner += "<td align='left'>"+v["title"]+"</td>"; htmlinner += "<td align='center'>"+v["writer"]+"cccc</td>"; htmlinner += "<td align='center'>"+v["date"]+"</td>"; htmlinner += "<td align='center'>"+v["like"]+"</td>"; htmlinner += "<td align='center'>"+v["open"]+"</td>"; htmlinner += "<td> </td>"; htmlinner += "</tr>"; htmlinner += "<tr height="1" bgcolor="#d2d2d2"><td colspan="6"></td></tr>"; htmlinner += "<tr height="1" bgcolor="#82b5df"><td colspan="6" width="752"></td></tr>"; }); htmlinner += '</table>' $("#list").html(htmlinner); $("#test").attr("disabled", true); /* if(mymap.get("번호")){ row.insertcell(mymap.get("번호")).style.width = "73"; } else if (mymap.get("글쓴이")) { row.insertcell(mymap.get("글쓴이")).style.width = "73"; } else if (mymap.get("제목")) { row.insertcell(mymap.get("제목")).style.width = "379"; } else if (mymap.get("등록일")) { row.insertcell(mymap.get("등록일")).style.width = "164"; } else if (mymap.get("추천")) { row.insertcell(mymap.get("추천")).style.width = "58"; } else if (mymap.get("조회")) { row.insertcell(mymap.get("조회")).style.width = "58"; }*/ } }); } function init(){ var htmlinner = html; htmlinner += '<tr align="center" bgcolor="#ffffff" height="30">' htmlinner += '<td colspan="6">등록된 글이 없습니다.</td>' htmlinner += '</tr>' htmlinner += '<tr height="1" bgcolor="#d2d2d2"><td colspan="6"></td></tr>' htmlinner += '<tr height="1" bgcolor="#82b5df"><td colspan="6" width="752"></td></tr>' htmlinner += '</table>' $("#list").html(htmlinner); $("#test").attr("disabled", false); } </script> </head> <body onload="javascript:getforumrow()"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr height="5"><td width="5"></td></tr> <tr style="background:url('img/table_mid.gif') repeat-x; text-align:center;"> <td width="5"><img src="img/table_left.gif" width="5" height="30" /></td> <td width="73">번호</td> <td width="73">글쓴이</td> <td width="379">제목</td> <td width="164">등록일</td> <td width="58">추천</td> <td width="58">조회</td> <td width="7"><img src="img/table_right.gif" width="5" height="30" /></td> </tr> <tr height="25" align="center"> </tr> <tr height="1" bgcolor="#d2d2d2"><td colspan="6"></td></tr> <tr id="1strow"> </tr> <tr height="1" bgcolor="#82b5df"><td colspan="8" width="752"></td></tr> </table> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr><td colspan="4" height="5"></td></tr> <tr align="center"> <td><input type=button value="글쓰기" onclick="window.location='boardwrite.jsp'"></td> </tr> </table> </body> </html>
i trying show forum list of q&as. when run it, errors.
syntaxerror: missing ; before statement bulletinboardcolumns.jsp:63:32 referenceerror: getforumrow not defined bulletinboardcolumns.jsp:1:12
i cannot find mistakes.. ask guys help..
map<string, object> mymap = new hashmap<string, object>();
following code not javascript code. javascript has map object, weakmap. hashmap
java.
replace aboce code with
var mymap = new map();
all other code looks fine working.
Comments
Post a Comment