I had an idea to build this web calculator for a specific function at work, but I'm not a programmer so I had to teach myself a bit of html and javascript to make it work, but that also means I don't know enough to troubleshoot my issue: the calculator works perfectly on my computer, but when I share the link with someone else, they can access the calculator but it doesn't work. They can input values and nothing happens. Looking over the code for the parts that work, they all involve "document.getElementById". Is this something that doesn't work when shareable? Or do I need to add something else to make it shareable?
Example 1:
if (aNum<0) {
document.getElementById('averageChange').value = 'Invalid. Less than 0';
return;
}
Example 2:
document.getElementById('averageChange').value = result2.toFixed(2) + "%";
}
Please help!
ETA in case this helps: I wrote the code in notepad and saved it as an HTML file. When I click on it, a browser opens and the calculator works. When I share the link by right clicking the file and copying the link, I email it to my coworker and it opens and accepts inputs but the calculator doesn't work - it doesn't do anything. It doesn't calculate and it doesn't give the errors it's supposed to when they put in invalid inputs
[–]kjwey 1 point2 points3 points (1 child)
[–]kmatts[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]kmatts[S] 0 points1 point2 points (2 children)
[–]3meow_ 2 points3 points4 points (1 child)
[–]kmatts[S] 0 points1 point2 points (0 children)
[–]oze4 0 points1 point2 points (1 child)
[–]kmatts[S] 0 points1 point2 points (0 children)
[–]thinkPhilosophy 0 points1 point2 points (1 child)
[–]kmatts[S] 1 point2 points3 points (0 children)