Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
CSS
Unhandled exception at line 19, column 15 in ms-appx://6d58f381-98f8-4be7-b73a-47cb89dfe1b6/default.html

0x800a1391 - JavaScript runtime error: 'init' is undefined

If there is a handler for this exception, the program may be safely continued.
Posted
Updated 1-Aug-13 2:15am
v3
Comments
rharsha123gmail 1-Aug-13 7:42am    
visual studios 2012 metro app ....
local machine

1 solution

This may cause because you are trying to get canvas object before loading the DOM elements.
Solution is call a method onload of body and init canvas inside that funtcion.

HTML
<body onload="init()">

C#
function init() {
   canvas = document.getElementById("gameCanvas");;
   context = canvas.getContext('2d');
}


Hope this helps you
Happy Coding :)
 
Share this answer
 
Comments
rharsha123gmail 1-Aug-13 8:07am    
still am I getting the error as..............
0x800a1391 - JavaScript runtime error: 'init' is undefined
Sreejith MV 1-Aug-13 12:25pm    
can you share the code where you add the init() function? and do you add the init() function inside js file or <script></script> tag.
rharsha123gmail 2-Aug-13 4:58am    
thanks for ur help.............

the code is not working.......

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900