Debugging HTML5 Apps in the Windows Phone Emulator

by Steven18. September 2012 16:32

As IE doesn't have a console you don't get any output to the VS2010 debug window which makes it frustrating to debug! To help, add the following to the HEAD of your HTML page:

<script type="text/javascript">// <![CDATA[// adds logging capabilities to ie clientsif(typeof window.console == "undefined") { 
window.console = {log:function(str){window.external.Notify(str);}}; 
}window.onerror=function(e){console.log("Error ::" + e);};console.log("Installed console ! ");
// ]]></script>

Enjoy :-)

Tags: , , ,

Tech

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

 
Steven Livingstone-Perez is VP Engineering at KILTR, creator of Valebrity and other things. He is married & has two children.
 
He mains the VentureIQ blog focusing on tools for startups.

Books I've Written

What I Do

undefined

Founder

 

undefined

VP Engineering