Jump to content
Larry Ullman's Book Forums

Ch- 7 Creating Functions Question


Recommended Posts

Hello! I'm loving this book on Javascript. It was given to me and probably the best book I've read on javascript! (I'm still new at it) Although, I seem to be having a problem that I cant seem to figure out.

You know the exercies sorting an array with a user defined function? Well in the setText() function I was creating the IF statement for the elementId and message.

 

if( (typeof elementId == 'string') && (typeof message == 'string')){

var output = $(elementId);

if(output.textContent !== undefined){

output.textContent = numbers;

} else {

output.innerText = numbers;

}

}

 

The problem is that the output.textContent and the innerText that are assigned to numbers doesn't seem to work! The "numbers' don't seem to be assigned to a value. As it says "Unresolved variable or type."

 

This happened in the last exercies I did with the modefied days.js. Any help would be awesome!

 

Thanks

Link to comment
Share on other sites

Kudos for figuring it out. This was an error on my part, I believe: a late copy and paste that didn't get fixed. It's listed on the errata page, which you can check when you have a true mystery like this. Apologies for the confusion!

Link to comment
Share on other sites

 Share

×
×
  • Create New...