Please help with Weather App task

Please help with Weather App task
0

#1

Here is my pen: http://codepen.io/bencarp/pen/qRbKeM.
Here is what I see in the console:

  1. The error appears occasionally I don’t know why.
  2. The code below runs automatically, without the element being clicked.
$('#degrees').click(setTemp());

Please help,
Thanks,
Ben


#2

Hi Ben. I’ve just barely finished this challenge myself, and from what I’ve seen, it’s a security issue. Here’s more information, but the gist of it is that you should try using jsonp instead of json.


#3

Hi, I used Ajax request, and it solved the problem.
I still have a problem with the setTemp function running, even though the click condition was not met.


#4

Hey Ben. I’m not 100% sure but could it be because #degrees is not a button?


#5

It does not have to be a button. You can create click events on any (or almost any) html element.