[jQuery] Coldfusion / Jquery Addition Operator Question
I'm trying to add numbers together like this:
var tpdSum = 0;
tpdSum = 0
<cfloop from="1" to="#arrayLen(session.cart)#" index="i">
+ $(tpd_#i#).text()
</cfloop>;
alert(tpdSum);
But, instead of adding them, I'm getting a variable that looks like
this: 0 2 5
So, it's treating the numbers as strings and concatenating them
instead of treating them like numbers and adding them.
What am I doing wrong?