Hi i am currently trying to tidy some code up by moving some javascript into a seperate file however i am having a problem with parsing a variable into that the script needs this is the code i have tried so far: The Script:
<script src="@routes.Assets.versioned("javascripts/percentageBarScript.js.percentage(total, incomplete)")" type="text/javascript"></script>
code in JavaScript:
function percentage(total, incomplete) {
var PercentT = Math.round((((total- incomplete) / total) * 100)).toString() + "%";
var barProgress = document.getElementsByClassName("complete")[0].getElementsByClassName("bar")[0].style.width = PercentT;
var barText = document.getElementsByClassName("complete")[0].getElementsByClassName("bar")[0].textContent = PercentT;
}