Avatar of Robb Hill
Robb Hill
Flag for United States of America

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.ExpandYearCategoryTree ? "true" : "false" %>
                });

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>    

Open in new window

JavaScriptHTML

Avatar of undefined
Last Comment
Tom Beck

8/22/2022 - Mon