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");
}
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");
}
Share
Improve this question
asked Jan 22, 2013 at 14:09
Doc HolidayDoc Holiday
10.3k32 gold badges102 silver badges153 bronze badges
2 Answers
Reset to default 8That'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.
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' />"});
}