Error when using data tables


When I run the code in this project:

I keep getting this error message when I try to set the image and the picture does not appear.

WARNING: Line: 11: setImageURL() url parameter value (undefined) is not a string.

When I copy and paste the image address from the data table it works. I have copied the code from the examples so I am not sure what I am getting wrong. Thanks for your help. Andrew

Hi @andrew.c.wilson,

I spent a long time trying to fix this code. I set up console.log statements to find out what things were, and they kept coming up undefined. Weird.

Then I looked at Line 1 again:

What were those brackets around getColumn() intended to do? I took them out & the code worked great (link to my remix)! I’d encourage your student to look for simple typographical errors that break the project.

PS: Look at lines 6 & 9 again, and consider what happens to the dog whose pic is at index 0. Think about how to account for that, and then look at how I modified my code.

Hope that helps!
–Michael K.

1 Like


Thanks so much. Code is working perfectly! This is the first time I posted and I am really impressed with the support. I truly appreciate the time you both put into your replies. Thanks again. Andrew