Hello,
After spending a couple of hours trying to figure out why my custom popup editor template was failing with this javascript error in the kendo.all.min.js file: "0x800a03f1 - JavaScript runtime error: Expected '}' "
it turned out to be an inline javascript comment that was causing the error. I have a script tag at the top of my template with a couple of javascript functions and in them are some single-line comments using the '//' syntax. When I remove those the popup editor works just fine and when I put them back in it throws the error. Why is this happening? Is this a known issue? Is it documented anywhere?
Thanks,
Mike
5 Answers, 1 is accepted
I assume the cause for this issue is that you are using a hash ('#') symbol in the commented code which should be escaped. Please check out the following help article which elaborates more on using templates.
I hope this information helps.
Regards,
Kostadin
Telerik by Progress

Hello Kostadin,
Actually, in this instance, using a ('#') isn't the problem. Just using a simple in-line comment causes the popup edit template from loading:
Putting this at the top of the template will cause the script error. I also tried escaping the comment with no luck. Please try it yourself and see if you get the same results.
<script>
function someFunction(e) {
//some comment
}
</script>
Thanks,
Mike
The cause for this issue is that the entire template is rendered on a single line and when using a comment like that tall the code until the end of the row get commented. In case you want to use a comments inside the template you can use the following syntax.
<script>
function
someFunction(e) {
/*some comment*/
}
</script>
I hope this information helps.
Regards,
Kostadin
Telerik by Progress

Hi Kostadin ,
Thanks for the reply and I would like to ask for a feature? Like me, I believe most people are not intimately aware of what's going on under the covers with kendo all the time and I believe this situation is one of them. It would be nice if kendo could throw a more meaningful error in this situation than the arbitrary one that I sent in my original post. Perhaps some preprocessing of the template to look for this condition and throw an error explaining it. This would avoid the couple hours of frustration I endured when I hit this error.
Thanks,
Mike
I will forward your requirement to our developers and if a more useful information could be set they will include it in some of our future releases.
Regards,
Kostadin
Telerik by Progress