Hey guys. I am getting an error in this jsp code in line13 i.e PopulateTextbox obj = new PopulateTextbox(). What is wrong in my code. Am i declaring the function at wrong plae or missing braces anywhere. Please help. ?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="classes.web.PopulateTextbox" %>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
<script>
$(document).ready(function() {
	  var foo = function()
	  {
		  PopulateTextbox obj = new PopulateTextbox();
		  var arlene1 = new Array();
		  arlene1 = obj.method();
	  };
	  foo();
		//arlene1 = ["Shaan","kapil","abhinav"];
    $("input#autocomplete").autocomplete({
    source: arlene1
});
  });
  </script>
  
  <script>
  $(document).ready(function() {
    $("input#hello").autocomplete({
    source: ["c++", "java", "shaan", "coldfusion", "javascript", "asp", "ruby"]
});
  });
  </script>
</head>

<body  style="font-size:62.5%;">
  
<input id="autocomplete" />

<input id="hello">

</body>
</html>

The error details are as follows... ::

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)
Timestamp: Fri, 24 Feb 2012 09:25:54 UTC


Message: Expected ';'
Line: 13
Char: 21
Code: 0
URI: http://localhost:8080/GenerateReport/autojsp.jsp

Member Avatar for stbuchok

It looks to me like you are mixing up JavaScript/jQuery and JSP at line 13.

JavaScript/jQuery does have a PopulateTextbox object, not to mention the way you are declaring the variable for it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.