Can't load API data

  function setup() { 
  createCanvas(400, 400);
  var url = ""

Hi! When I try to load JSON data from this weather API, I get this error:

Uncaught TypeError: Cannot read property ‘split’ of undefined (: line 56)

I can’t find anything in the reference, and in this video on The Coding Train which I’m following, I can’t see any difference between what Mr Shiffman is doing and what I’m doing.


I have tried passing the string in as an argument directly, as a variable such as in the code; specifying “jason” and “jasonp” in the datatype, using preload, and generally fumbled about.

I have also tried pasting the address into the URL bar and that does work.

Does anyone have any idea?

I have omitted the API key for privacy.


I have managed to solve the problem by manually changing the “http” element to “https”.