BorisMoore / jquery-tmpl

The original official jQuery Templates plugin. This project was maintained by the jQuery team as an official jQuery plugin. It is no longer in active development, and has been superseded by JsRender.
3.23k stars 1.01k forks source link

Check if what we are trying to call is callable before calling it. #77

Closed digitalxero closed 13 years ago

digitalxero commented 13 years ago

add a safety check to make sure we are calling a function. In several of my nested templates newItem.tmpl was getting set as an object or array and would crash here. Adding the check and setting the _ctnt to the obj or array fixed this and cause the templates to parse as expected.

digitalxero commented 13 years ago

No but I will make one tomorrow

BorisMoore commented 13 years ago

Thanks Digitalxero. Yes, I would also like to see an example of how this happens before integrating this change. There have been cases when people have hit an error on that line of code because they were in fact not using the template APIs correctly... So it would be great to see a complete example...

rdworth commented 13 years ago

Thanks for taking the time to submit this pull request. Unfortunately this plugin is no longer being actively developed or maintained by the jQuery team. See README for more info.