#need help approaching this prob

9 messages · Page 1 of 1 (latest)

trail widget
#

The approach to fixing this really lies in understanding the error message first of all and then diagnosing what's wrong.

The message is basically telling you that your query is incorrect and it can't figure out what you're asking.

At first glance you seem to provide all the necessary information "scheme", "mode" but you don't show anywhere what values you're passing...

So does "getColor" and "getSchemeMode" contain gobbledegook or valid values?

One approach would be to to construct your URL on a sepate line and then console.log the result so you can see what's being passed to the api OR even just logging the contents of those two variables and see what's there...

console.log(getColor);
console.log(getSchemeMode);

As a side-note, those are horrible names for variables... "getAnything" basically implies a function of some kind and not a variable so I'd avoid doing that.

shadow phoenix
#

Oops my apologies I see your point. this is the rest of my code to link the DOM, and yes I now see how those can be poor choices for naming conventions. Thank you Bill

#

I also updated the names for those variables and omitted the "get" words

sturdy fjord
#

I think the problem is that the color input returns its value with a "#" in front of the hex code, but the API expects the hex value without the "#."

#

You can use substring or slice to remove the # before the hex value: seedColors.value.substring(1)

#

I hope this helps!

shadow phoenix
#

Thanks Mark!

sturdy fjord
#

I'm glad I could help!