0

I am using javascript to extract data from a .json (tmdb) Attached file Api code This is the code I'm using to extract the data from tmdb "still_path" & "episode_number".

"next_episode_to_air" == e && ((g = l.next_episode_to_air.still_path),
$('#next_still_path input').val(g));
"next_episode_to_air" == e && ((epi = l.next_episode_to_air.episode_number),
$('#next_episode input').val(epi));

And this is the .json from which it extracts the data with which it works fine.

  "next_episode_to_air": {
    "episode_number": 20,
    "still_path": "/1hqIxnQtPlq7HbSGRYWS1sANidJ.jpg"
  },

The problem is when the .json has the value "null" my script stops working.

"next_episode_to_air": null,

Could someone please help me, leave the 3 files attached.

I tried using "if" but it gave me an error.

0 Answers0