pre-compiling jsrender templates-Collection of common programming errors

I have a couple of jsRender templates that are used on all pages. Instead of using the script tag method, I would prefer to precompile them and put resulting functions in an external js file.

I saw a previous question that asked this but the method described doesn’t seem to work anymore or I am doing something wrong.

I called $.templates(“#myTemplate”) from the console which msanjay suggested and copied/renamed the anonymous function and get something like this (which looks a bit odd to my untrained eye):

function myTemplate(data, view, j, b, u) {
    var j = j || jQuery.views, h = j.converters.html, ret; try {

        return "