what does
script.setAttribute('src', '/json?callback=loadJsonPhotos');
JavaScript code mean?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s a little snippet of code to set the
src(source) attribute of a Javascript include tag to/json?callback=loadJsonPhotos. Once that line of code runs, the browser will fetch the data from that URL and execute the script that returns. The data that script returns will be wrapped in a function like so:All you need to do to use that data is write a function called loadJsonPhotos that will be called once the data has loaded.