Bear Bibeault

Author and ninkuma
+ Follow
since Jan 10, 2002
Bear likes ...
IntelliJ IDE Java jQuery Mac Mac OS X
Author of:
Secrets of the JavaScript Ninja, 1st and 2nd editions,
jQuery in Action, 1st, 2nd and 3rd editions,
Ajax in Practice, and
Prototype and Scriptaculous in Action
Austin, TX
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt Green check
expand Greenhorn Scavenger Hunt Green check

Recent posts by Bear Bibeault

jQuery *is* JavaScript, but regardless...

Set breakpoints where you think the code is going wrong.

You might also want to rethink your naming of variables and parameters. The ones you have seem confusiing.
If you are already using jQuery why would you use document.getElementById rather than jQuery notation?

Paul Clapham wrote:You're kidding! That's pretty close to professional malpractice in my book.

Not to pile on -- but I will -- it's like teaching an electronics course using vacuum tubes.

I know you have no control over the curriculum, but please do be aware that, as Paul said, JSP scriptlets have been obsolete since 2002. When you get a chance (if servlets and JSP will be important to you going forward) study up on the EL (Expression Language) and JSTL (JSP Standard Tag Library) as the modern equivalents.

Good luck with your studies.
2 days ago
OK, first things first. Please tell us how you are running this code. Obviously not in the browser. With NodeJS? Java's JS runtime?

If NodeJS, what version? It may not support all ES6 syntax yet.

You may need to set up a Babel build to convert to ES5 for execution.

Which tutorial is this coming from? You're not giving us much to work with here.

And checking for syntax errors is not considered "debugging". Debugging happens at run time.

Rocky Rocha wrote:My code is fine, I debugged it. Anyone know what's going on?

How can you debug it if it won't run?
The destructuring syntax is new with ES6. Are you sure your interpreter supports it?
Before digging into any depth in your code, using a 2-D matrix to store structured data is a huge anti-pattern. You data should be a single-dimension array of objects, each with object properties to reflect the values of each question: its text, choices, and so on.

Restructure your data, refactor your code to accommodate the change, and then see if any problems still exist.

Think about these conditions. How may times does the loop iterate?
Please research the allowed values for the font-style property. Hint: it's not font names.
When a class is created, only a single instance is created, not both a subclass instance and a superclass instance. So there's only the subclass instance that inherits from the superclass.
1 week ago
I get my eyes checked yearly. Here how it goes:

Dr. Weaver: Cover your right eye and read as many lines as you can.
Me: (reads maybe top two lines)
Dr. Weaver: Now cover your left eye and read the chart.
Me: What chart?

My right eye is useless. It's what called a lazy eye. For whatever reason (speculation is that my congenital hemangioma affected the optic nerve during development), my visual cerebral cortex for the right eye never developed.

My left eye is extremely far-sighted. Without my glasses I cannot read anything but the largest of signs.

If the zombie apocalypse comes and I break my glasses, I'm screwed.
1 week ago
P.P.S XHTML is dead. Don't go there.
2 weeks ago
P.S. Make sure that whatever book you choose is current with coverage of HTML5.
2 weeks ago
Basic HTML is pretty easy to learn.

But to create fully functioning and styled pages also takes JavaScript and CSS. Those subjects can get deep pretty quickly. But almost any book targeted at novices can get you started.

(Historical note: I originally learned HTML around 1990 from the 1st edition of the HTML For Dummies book.)
2 weeks ago