Robb Hill
asked on
javascript snytax error
Can anyone see an issue with the syntax here?
The code compiles ...just complains that the syntax is not proper.
The error seems to be at the end of this line -
isExpanded: <%= Model.ExpandYearCategoryTr ee ? "true" : "false" %>
});
Here is the script:
The code compiles ...just complains that the syntax is not proper.
The error seems to be at the end of this line -
isExpanded: <%= Model.ExpandYearCategoryTr
});
Here is the script:
<script type="text/javascript">
<% if (Model.ShowYearCategoryTree)
{ %>
require(['ListDocs/yearCategoryTreeViewModel'], function(viewModel) {
viewModel.init({
years: [ <%= String.Join(",", Model.YearCategoryTreeYears) %>],
fileAreaSiteId: <%= Model.SiteId %>,
subscriberId: <%= Model.UserSessionVariables.SubscriberId %>,
isExpanded: <%= Model.ExpandYearCategoryTree ? "true" : "false" %>
});
});
<% } %>
require(['ListDocs/fileDrop'], function(fileDrop) {
fileDrop.init({
fileDropPanel: document.body,
subscriberId: <%= Model.UserSessionVariables.SubscriberId %>,
getAddFilesData: function($fileDropItem) {
var data = { fileAreaSiteId: <%= Model.SiteId %> };
if($fileDropItem.hasClass("jqgrow")) {
data.documentId = $fileDropItem[0].id;
}
return data;
}
});
});
</script>
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I dont know..its strange...if I end it with a comma the error goes away..but am not sure how thats effecting the code..as that does not seem like proper syntax
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanks
You're welcome. Glad to help. Thanks for the points.
ASKER