-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
radios.json #2
Comments
Hey, The You don't want to edit
That being said, if you plan to keep the radio sources in your source code, there is no particular reason to have them in a JSON file, request them every time and have to update the requestURL. I initially did it for the sake of messing around with http requests. //radios.js
export default { // <- Export the object.
// Leave everything else as is.
"music": [
// ...
} Then, import it in //populateDOM.js
import radios from '../radios.js'; // <- Import the radios.
export function requestJSON(){
renderRadios(radios); // <- Add this.
// Delete everything else.
}
function renderRadios(radioData) { //<- Rename the parameter to 'radioData'.
const radioData = request.response; // <- Delete this line.
// Leave the rest as is.
setFirstRadio(radioData);
// ...
} There is a lot of refactoring and cleanup that can be done, feel free to mess around. 😄 |
I want to edit radios.. If I will change infos in radios.json and change location in populateDOM.js, it will still load old radios.json. I found second call in mains.js, but If i will change it to my radios.json location, website will be blank.. so.. any ideas, how to fix it?
The text was updated successfully, but these errors were encountered: