1

has anyone had issues with the underscore.js built-in template engine using a windows phone 7?

My App stops running when it comes to this line:

var Template = {
         loadingWheel:        _.template($("#loading_wheel").html())
};

An alert() before that line will be performed, an alert() after doesn't happen so I assume it's something about underscore templates. I alread tried renaming Template to something else, I guess it's not about a reserved name or something.

#loading_wheel is an inline script-tag template that looks like this:

<script type="text/template" id="loading_wheel">
  <div class="loading">
    <img src="/images/loading.gif" />
   </div>
</script>

Hum, quite simple, isn't it?

I'm using Backbone.js 0.9.2, Underscore.js 1.3.3 and Zepto 1.0. The App is working on several iOs 4+5, Android 2.3, 2.6, 4.0, 4.1 and Blackberry Devices. Just Windows Phone 7 is not showing anything.

Achim Koellner
  • 913
  • 12
  • 22
  • 2
    Take a look at this question and see if you can figure out the error or at least provide us with more information. http://stackoverflow.com/questions/5198808/how-do-i-debug-internet-explorer-on-windows-phone-7 – JaredMcAteer Aug 31 '12 at 14:51
  • Thanks Jared, the phone in question is an HTC 7 Mozart which obviously doesn't support Bookmarklets, at least I didn't get Mobile Perf running on it. Think I need to ge a PC to debug it, let you know if I can find out anything else. – Achim Koellner Aug 31 '12 at 15:57

1 Answers1

0

It turned out that the problem wasn't underscore specific but caused by the zepto framework, that obviously doesn't support windows phone browsers.

This is why this line of code failed:

 _.template($("#loading_wheel").html())

Using jquery instead works fine (but loads some 65KB more).

Achim Koellner
  • 913
  • 12
  • 22