Interrogate tempo.js objects for existence

I'm using tempo.js 2.0 and I noticed after my Ajax requests - the response fails to re-render correctly, someone on this site pointed out, tempo.js renders fine if you don't prepare the container again, I tested and they are correct. This works: var template = null; function populate(){ if (template == null){ template = Tempo.prepare("myDivId"); } template.render(data); } Anyone know how I can interrogate some value in the DOM or Tempo so I can remove my global variable? var template = null; The only thing I can think of is using jQuery and testing if tempo el type expressions exists {{ someValue }} I tried reading the code and I don't understand javascript enough. Big thanks!
I dont think it can be done, the examples use global variables, I think I was looking for a isPrepared method. I'm also learning I suck at javascript.

以上就是Interrogate tempo.js objects for existence的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准