Results 1 to 8 of 8

Thread: Getting error while using the javascript to draw the line graph inside the while loop

  1. #1
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Getting error while using the javascript to draw the line graph inside the while loop

    I am using the javascript to draw the line graph in my application.
    i have implemented successfully.
    But now i am trying to include the same javascript inside a while loop i am getting

    Message: Object doesn't support this property or method
    Line: 83
    Char: 2
    Code: 0
    URI: http://localhost:8080/o2a_server/js/wz_jsgraphics.js

    on the browser.

    Basically i am fetching some objects from the database and i need to draw the graph for each object. So i have included the javascript inside the while loop of the resultset.

    Can you please let m eknow what might be the causing this error..

    Thanks for your time.

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,793
    Thanks
    2
    Thanked 418 Times in 412 Posts

    Default

    your link is broken
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    What exactly you mean by link is broken.

    Please explain.

    Thanks

  4. #4
    Join Date
    Jul 2008
    Posts
    128
    Thanks
    0
    Thanked 17 Times in 16 Posts

    Default

    Quote Originally Posted by Gurudev Arer View Post
    What exactly you mean by link is broken.

    Please explain.

    Thanks
    We need to see

    http://localhost:8080/o2a_server/js/wz_jsgraphics.js

    But that's not an internet URL.

  5. #5
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    function pntCnvIe()
    {
    this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm);
    this.htm = '';
    }

    Is the part of the code where i am getting the error :
    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.2)
    Timestamp: Fri, 27 Aug 2010 11:09:11 UTC


    Message: Object doesn't support this property or method
    Line: 83
    Char: 2
    Code: 0
    URI: http://localhost:8080/o2a_server/js/wz_jsgraphics.js

    You need to login into the system to look at that page.
    Code:
    <TR HEIGHT="99%">
    		<TD>
    		<TABLE ALIGN="center" BORDER="0" HEIGHT="100%" WIDTH="100%" CELLPADDING="0" CELLSPACING="0">
    						<%
    						Connection connection = null;
    						Statement statement = null;
    						ResultSet rs = null;
    						try 
    						{								            	
    							Class.forName("com.mysql.jdbc.Driver").newInstance();
    							connection  = DriverManager.getConnection(conn_url,username,password);
    							statement = connection.createStatement();
    							String QueryString = "select COW_ID,COW_NAME from oxy_cows where cow_id<>1 and MALE_OR_FEMALE ='F'";
    							rs= statement.executeQuery(QueryString);
    							while (rs.next()) 
    							{
    								cow_id=rs.getString(1);
    								cow_name=rs.getString(2); %>
    								<tr height="9%" valign="middle">
    								<td align="center">
    								<center>
    									<div id="myCanvas" style="overflow: auto; position:fixed;height:300px;width:100%; "></div>
    									<script>
    										var g = new line_graph();
    										var g2 = new line_graph();
    										var color = 4;
    										var color1 = 55;
    										<%
    										Connection connection1 = null;
    										Statement statement1 = null;
    										ResultSet rs1 = null;
    										try 
    										{
    												Class.forName("com.mysql.jdbc.Driver").newInstance();
    												connection1 = DriverManager.getConnection(conn_url,username,password);
    												statement1 = connection1.createStatement();
    												String QueryString1 =null;
    												QueryString1 = "select date_format(MILK_DATE,'%d'),MORNING_MILK from oxy_milk_production where COW_NUMBER='"+cow_id+"'and milk_date between '"+doctor_milking_allcow_from_date+"' and '"+doctor_milking_allcow_to_date+"' order by milk_date";
    												rs1 = statement1.executeQuery(QueryString1);
    												while (rs1.next()) 
    												{ %>
    													g.add('<%=rs1.getString(1)%>', <%=rs1.getString(2)%>);
    												<%}
    												rs1.close();
    										    	statement1.close();
    										    	connection1.close();
    										}
    										catch (Exception ex) 
    										{
    										    %><FONT SIZE="+3" COLOR="green"> <%
    										     out.println("Unable to connect to database.");
    										    statement1.close();
    									    	connection1.close();
    										}
    										%>
    										
    										<%
    										Connection connection2 = null;
    										Statement statement2 = null;
    										ResultSet rs2 = null;
    										try 
    										{
    												Class.forName("com.mysql.jdbc.Driver").newInstance();
    												connection2 = DriverManager.getConnection(conn_url,username,password);
    												statement2 = connection2.createStatement();
    												String QueryString2 =null;
    												QueryString2 = "select date_format(MILK_DATE,'%d'),EVENING_MILK from oxy_milk_production where COW_NUMBER='"+cow_id+"'and milk_date between '"+doctor_milking_allcow_from_date+"' and '"+doctor_milking_allcow_to_date+"' order by milk_date";
    												rs2 = statement2.executeQuery(QueryString2);
    												while (rs2.next()) 
    												{ %>
    													g2.add('', <%=rs2.getString(2)%>);
    													
    												<%}
    												rs2.close();
    										    	statement2.close();
    										    	connection2.close();
    										}
    										catch (Exception ex) 
    										{
    										    %><FONT SIZE="+3" COLOR="green"> <%
    										     out.println("Unable to connect to database.");
    										    statement2.close();
    									    	connection2.close();
    										}
    										%>
    										g.setMax(10);g.setColor(color);
    										g2.setMax(10);g2.setColor(3);
    										g.render("myCanvas", "Blue: Morning, Red: Evening");
    										g2.render("myCanvas", "");
    										delete g;
    										delete g2;
    									</script>
    									<FONT color="8A5C2E" SIZE="5"  STYLE="font-family: sans-serif ">Milking Graph for <%=cow_name%>. </FONT>
    								</center>
    								</td>
    								
    							</tr>
    						  <%}
    							rs.close();
    							statement.close();
    							connection.close();
    						  %>
    		</TABLE>
    					<% } 
    						catch (Exception ex) 
    						{
    						 	%> <FONT SIZE="+3" COLOR="green"> <% out.println("ABCSINGLE:Unable to connect to database.");
    						 	statement.close();
    							connection.close();
    						}
    						%> </FONT></TD>
    	</TR>
    Is the code where i have used the script.

    Thanks

  6. #6
    Join Date
    Jul 2008
    Posts
    128
    Thanks
    0
    Thanked 17 Times in 16 Posts

    Default

    Quote Originally Posted by Gurudev Arer View Post
    URI: http://localhost:8080/o2a_server/js/wz_jsgraphics.js

    You need to login into the system to look at that page.
    If you want any help it's you who has to log in to the system, copy the contents of that file to the clipboard, then paste it here.

  7. #7
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi All,

    Error message:

    Message: Object doesn't support this property or method
    Line: 83
    Char: 2
    Code: 0
    URI: http://www.oxygenacres.com/js/wz_jsgraphics.js

    I have uploaded it to the hosting server. Above is the error message what i get at the browser.

    Thanks for your time.

  8. #8
    Join Date
    Jul 2008
    Posts
    128
    Thanks
    0
    Thanked 17 Times in 16 Posts

    Default

    Code:
    function pntCnvIe()
    {
    	this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm);
    	this.htm = '';
    }
    The error message seems to indicate the line above. There seem to be IE issues with insertAdjacentHTML, but I'm not getting involved with third-party code.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •