Reputation: 10254
getting this error:
at this line: totalFundedLabel.push( "label": "Funded");
JS:
var totalFunded = '${totalFunded}';
var totalUnfunded = '${totalUnfunded}';
var totalFundedValue = [];
var totalFundedLabel = [];
var totalFundedText = [];
var unFundedValue = [];
var unFundedLabel = [];
var unFundedText = [];
if (totalFunded != null)
{
totalFundedLabel.push( "label": "Funded");
totalFundedValue.push( "value": <tld-msst:fc-value var="${totalFunded}"/>);
totalFundedText.push( "toolText": "<fmt:formatNumber value='${totalFunded}' type='currency' groupingUsed='true' />");
}
if (totalUnfunded != null)
{
unFundedLabel.push( "label": "unFunded");
unFundedValue.push( "value": <tld-msst:fc-value var="${totalUnfunded}"/>);
unFundedText.push( "toolText": "<fmt:formatNumber value='${totalUnfunded}' type='currency' groupingUsed='true' />");
}
RENDERED HTML:
var totalFunded = '109321734.06';
var totalUnfunded = '381234572.79';
var totalFundedValue = [];
var totalFundedLabel = [];
var totalFundedText = [];
var unFundedValue = [];
var unFundedLabel = [];
var unFundedText = [];
if (totalFunded != null)
{
totalFundedLabel.push( "label": "Funded");
totalFundedValue.push( "value": "109321734.06");
totalFundedText.push( "toolText": "$109,321,734.06");
}
if (totalUnfunded != null)
{
unFundedLabel.push( "label": "unFunded");
unFundedValue.push( "value": "381234572.79");
unFundedText.push( "toolText": "$381,234,572.79");
}
Upvotes: 0
Views: 12756
Reputation: 1655
You had missing braces {
& }
in all the push statements
if (totalFunded != null)
{
totalFundedLabel.push( {"label": "Funded"});
totalFundedValue.push( {"value": <tld-msst:fc-value var="${totalFunded}"/>});
totalFundedText.push( {"toolText": "<fmt:formatNumber value='${totalFunded}' type='currency' groupingUsed='true' />"});
}
if (totalUnfunded != null)
{
unFundedLabel.push( {"label": "unFunded"});
unFundedValue.push( {"value": <tld-msst:fc-value var="${totalUnfunded}"/>});
unFundedText.push( {"toolText": "<fmt:formatNumber value='${totalUnfunded}' type='currency' groupingUsed='true' />"});
}
Upvotes: 0
Reputation: 413737
That's a syntax error because, well, it is. You probably want:
unFundedLabel.push({ label: "unFunded"});
The curly braces create an object, with a property called "label". You don't need quotes on the property name if it looks like an identifier (usually). Looks like all your .push()
calls are broken in that same way.
Upvotes: 8