#First javascrpt challenge
23 messages · Page 1 of 1 (latest)
This works for me
const home = document.getElementById('homescore');
const guest = document.getElementById('guestscore');
const incrementBtn = document.getElementById('increment');
const decrementBtn = document.getElementById('decrement');
let count = 0;
let count2 = 0;
function increment(value) {
count += value;
home.textContent = count;
console.log
}
function increment2(value) {
count2 += value;
guest.textContent = count2;
console.log(count2);
}
incrementBtn.addEventListener('click', increment);
If this does not work, Please share the scrim. I will take a look at it.
Could be a deployment issue. In the browser dev tools, look at the Network tab, reload the page, and verify that all of the supporting files (.css, .js) are being loaded properly.
It still didn't work, ill be sending you the link to the files on github... maybe you might spot my error there... As for the scrim that gave me this solo project, ill also link that below
This is not a GitHub link, BTW.
yeah thats the link to the video that made me do the solo project on scrimba
It looks like this could be a Netlify deployment of your GitHub repo of a downloaded Scrimba zip file. Try following these steps to repair the deployment: #general-chat message
Or, you could remove the package.json file from the GitHub repository, then deploy a new Netlify instance (specifically, delete the current instance and deploy a new instance).
This is how the network lab looks like, i dont see my js file
I guess my point is that you shared two links, one titled "Scrim" and the other "GitHub", but they are both the same URL to the same Scrim lesson.
Oh my bad i'll edit that right away
Alright let me try that now
I realized that the URL to the Netlify site was in the screenshot, so I visited it and viewed the Network tab myself. It looks like this is the same "Netlify deployment" issue that would be fixed by following the repair steps that I linked to.
Looking at the GitHub repo further confirms that it is likely the deployment issue.
It's been a problem forever, and Scrimba has never addressed it, so don't feel bad. There's no way you could have know that it wouldn't "just work" when deploying the site following their instructions.
Thanks a lot for your help , i appreciate it a lot
Hey Michael , I just did as the steps you linked to said ad it works perfectly now. Thank you once again 😁
Hey Voss, declared the same function name twice. You had two increment
There are indeed two functions in the script, but one is increment and the other is increment2, so not the same names.
Yours was fine, Voss had the same function name twice. At least that's what I see in his screen shot. You had increment and increment2. But never mind. Not important.
Ok, I see what you're saying. One of the initial screenshots indeed shows the script with two increment functions defined. I was looking at the code in the GitHub repo, which has (obviously) been updated since that screenshot was captured.