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

$jQuery.tmpl error for empty strings #99

Open 2beers opened 13 years ago

2beers commented 13 years ago

Firefox error console return the following error:

Error: $.tmpl("", {title: "some title"}).appendTo is not a function

I used the following code: $.tmpl("", {title:"some title"}).appendTo("#element");

If I change the template string with something else than an empty string everything works ok. $.tmpl(" ", {title:"some title"}).appendTo("#element"); // this works OK

Hope this helps

BorisMoore commented 13 years ago

You are using a template with no content here. Is that your goal?

2beers commented 13 years ago

yes. I know I can make a check to see if the template is empty , but I though this might be an error so I reported. I think it's more a problem of debate. To me even if the template has no content it shouldn't throw an error, it will just return ""

BorisMoore commented 13 years ago

OK, thanks. I'll keep this open for considering adding in that support.

BorisMoore commented 13 years ago

TODO See corresponding fix https://github.com/BorisMoore/jsrender/commit/5a579d233c9830785ffcde734c63ab2490da3b0e

rdworth commented 13 years ago

Thanks for taking the time to submit this issue. Just wanted to let you know this plugin is no longer being actively developed or maintained by the jQuery team. See README for more info.