• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

java script error if the populated arrayList is empty in the page.  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

Here is my problem.
I have two seperate tables in my jsp page populated by two different db calls.
If one of the list is empty im getting the following error. The page is loaded but on the window i see the java script error.

'undefined' is null or not an object.
This happenes on page load.
Can anyone help me how to solve it.
 
Author and ninkuma
Marshal
Posts: 66787
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the HTML being sent to the browser using View Source. Is it what you expect? Is it valid? What do you need to do in the JSP to make sure that it emits valid markup?

Please show some effort.
 
Priya Vedan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tired before posting this. It didnt work.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66787
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try harder.

And look at it yourself. Does it look right? Is it valid?
 
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not like *we* can look at it anyway; there's no code.
 
Priya Vedan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your time.

Its not like i dint try at all and just posted it off.
I finally figured it out and the problem is i am not getting any script errors if i use a different version of browser.
being a new bie i asked some help.
I didnt post the code as it a large piece and by the way the code is in Valid format.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All I'm saying is that it's *impossible* to help with absolutely nothing to go on.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!