This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// After the first JSON is returned, we are going to convert the URL string by mapping over the array of objects and replacing the default cover image size. | |
.then( data => { | |
data.media.map( media => { | |
if(media.covers[0]){ | |
// Check if original image is one being served. | |
if(!media.covers[0].includes('original')){ | |
// Replace the cover image size with "original" image size. | |
media.covers[0] = media.covers[0].replace('R320x240', 'original'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// After the first JSON is returned, we are going to convert the URL string by mapping over the array of objects and replacing the default cover image size. | |
.then( data => { | |
data.media.map( media => { | |
if(media.covers[0]){ | |
// Replace the cover image size with "original" image size. | |
media.covers[0] = media.covers[0].replace('R320x240', 'original'); | |
// Add the item to the jsonPost array. | |
jsonData = [...jsonData, media]; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the array where we will store our JSON response. | |
let jsonData =[]; | |
// Get the original JSON from site | |
$.ajax({ | |
method: 'GET', | |
dataType: 'jsonp', | |
url: 'http://developers.modyo.com/media.json', | |
success: data => data.media, | |
error: err => console.log(err) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alert("This is working!"); |
NewerOlder