Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Problem to setup the style.display in javascript.

 
Ranch Hand
Posts: 639
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to change the css display attribute but this is not doing. My page is calling the javascript function when onclick in the cell table.
HTML page:

Javascript:

I appreciate any help.
 
Ranch Hand
Posts: 178
1
Android Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Line #19 in Javascript part looks suspicious - without having a closer look at the code. Using 'this' in Javascript is a kind of russhian roulette game. My guess is, that 'this' in line #19 is bound to something existing when the loop over the cells is executed rather than the the cell at the time the onclick function is triggered.

May be the following works:
Change line #19 from ...


... to

 
Cezar Apulchro
Ranch Hand
Posts: 639
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I made the change indicated but when I click in the table cell I'm receiving this error:

Thank you by assistance.
 
Sheriff
Posts: 67732
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you set breakpoints at strategic locations in the code to see what's actually going on?
 
Cezar Apulchro
Ranch Hand
Posts: 639
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How I do set breakpoints in jsp page?
image.jpg
[Thumbnail for image.jpg]
 
Roland Mueller
Ranch Hand
Posts: 178
1
Android Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:How I do set breakpoints in jsp page?


In browser tool that is open breakpoints are set in Javascript code by opening a file in tab "Sources" ("fontes" I guess in Spanish) and click one time on the left side of the line where you want the breakpoint. This can be done both in Javascript files or inside script elements inside html file.  
 
Bear Bibeault
Sheriff
Posts: 67732
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:How I do set breakpoints in jsp page?



Remember that JSP has nothing to do with the browser. JSP is a templating language that generates an HTML page on the server that gets sent to the client. What you see on the browser is the result of processing the JSP page on the server.

See this article for more information on how JSP is processed.

You set breakpoints using DevTools in webkit browsers, and similar tools in other browsers.

Trying to debug JavaScript without browser dev tools is like, well, this...

 
Cezar Apulchro
Ranch Hand
Posts: 639
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What this say me?
image.jpg
[Thumbnail for image.jpg]
 
Roland Mueller
Ranch Hand
Posts: 178
1
Android Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:What this say me?


The screenshot shows the code with my errorness recommendation (sorry for that!) and the debugger shows the same error message you already saw & reported three days ago (line #22 in screenshot). Can you undo the change and debug your original version the same way?

Cezar Apulchro wrote:I made the change indicated but when I click in the table cell I'm receiving this error:

 
Cezar Apulchro
Ranch Hand
Posts: 639
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After return to the origin of the problem the problem was solved. I don't understand why error was generated.

Thanks and best regards.
 
On top of spaghetti all covered in cheese, there was this tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic