javascript - IE8 Unexpected Identifier error in compiled JST -



javascript - IE8 Unexpected Identifier error in compiled JST -

i have number of templates compiling using grunt jst plugin. discovered compiled string causing "unexpected identifier" error in ie8, , have yet figure out why.

this["jst"]["/tpl/general/pagination.tpl.html"] = function(obj) {obj || (obj = {});var __t, __p = '', __e = _.escape, __j = array.prototype.join;function print() { __p += __j.call(arguments, '') }with (obj) { var page = page || 1, prevpage = 1, nextpage = 1, limit = limit || 12, total = total || limit, pages = math.ceil(total/limit), attributes = attributes || []; page = parseint(page); (page > 1)? prevpage = page - 1: false; (page < pages)? nextpage = page + 1: false;;__p += '\r\n\r\n'; if(total > limit){ ;__p += '\r\n\t<div class="pagination" '; for(var = 0; < attributes.length; += 1){ print("data-"+attributes[i].name+"='"+attributes[i].value+"' ");} ;__p += '>\r\n\t <ul>\r\n\t <li '; if(page == 1){ print("class='disabled'"); };__p += ' ><a href="#" data-page="' +((__t = (prevpage)) == null ? '' : __t) +'">prev</a></li>\r\n\t '; for(var = 1; <= pages; i+=1){ ;__p += '\r\n\t\t\t<li '; if(i == page){ print("class='active'"); };__p += ' ><a href="#" data-page="' +((__t = (i)) == null ? '' : __t) +'">' +((__t = (i)) == null ? '' : __t) +'</a></li>\r\n\t\t'; } ;__p += '\r\n\t <li '; if(page == pages){ print("class='disabled'"); };__p += ' ><a href="#" data-page="' +((__t = (nextpage)) == null ? '' : __t) +'">next</a></li>\r\n\t </ul>\r\n\t</div>\r\n'; } ;}return __p};

can see i'm missing here?

edit: uncompiled template:

<% var page = page || 1, prevpage = 1, nextpage = 1, limit = limit || 12, total = total || limit, pages = math.ceil(total/limit), attributes = attributes || []; page = parseint(page); (page > 1)? prevpage = page - 1: false; (page < pages)? nextpage = page + 1: false; %> <% if(total > limit){ %> <div class="pagination" <% for(var = 0; < attributes.length; += 1){ print("data-"+attributes[i].name+"='"+attributes[i].value+"' ");} %>> <ul> <li <% if(page == 1){ print("class='disabled'"); }%> ><a href="#" data-page="<%=prevpage%>">prev</a></li> <% for(var = 1; <= pages; i+=1){ %> <li <% if(i == page){ print("class='active'"); }%> ><a href="#" data-page="<%=i%>"><%=i%></a></li> <% } %> <li <% if(page == pages){ print("class='disabled'"); }%> ><a href="#" data-page="<%=nextpage%>">next</a></li> </ul> </div> <% } %>

i started getting inconsistent messages dev console regarding error located. ended having step through loading process of page alert methods see erroring out. unfamiliar issue in jquery, here doing:

$('head > title').html(newtitle);

in ie8 cannot modify document title in way. instead need use:

document.title = newtitle;

once set in place, started working. includes both site uncompiled templates , compiled. turns out had nil jst.

javascript internet-explorer-8 underscore.js-templating

Comments

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -