Friday 15 May 2015

asp.net mvc - Error when I used javascript spin.js library -



asp.net mvc - Error when I used javascript spin.js library -

i using asp mvc , need utilize spin.js not working. here code using.

<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>spin.js example</title> <script src="//cdnjs.cloudflare.com/ajax/libs/spin.js/1.2.7/spin.min.js"></script> </head> <body> <div id="foo"></div> <script> var opts = { lines: 10, // number of lines draw length: 7, // length of each line width: 4, // line thickness radius: 10, // radius of inner circle corners: 1, // corner roundness (0..1) rotate: 0, // rotation offset color: '#000', // #rgb or #rrggbb speed: 1, // rounds per sec trail: 60, // afterglow percentage shadow: false, // whether render shadow hwaccel: false, // whether utilize hardware acceleration classname: 'spinner', // css class assign spinner zindex: 2e9, // z-index (defaults 2000000000) top: 25, // top position relative parent in px left: 25 // left position relative parent in px }; var target = document.getelementbyid('foo'); var spinner = new spinner(opts).spin(target); </script> </body> </html>

but when run exception showed in line

var spinner = new spinner(opts).spin(target);

and message

"spinner not defined"

any ideas on how can resolve this?

using qualified path spin library, appears work fine when inserted here stackoverflow code snippet (literally copied question, no additional modifications). point perhaps other issue code (is entire page) or perhaps browser has cached causing issue.

class="snippet-code-html lang-html prettyprint-override"><!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>spin.js example</title> <script src="http://cdnjs.cloudflare.com/ajax/libs/spin.js/1.2.7/spin.min.js"></script> </head> <body> <div id="foo"></div> <script> var opts = { lines: 10, // number of lines draw length: 7, // length of each line width: 4, // line thickness radius: 10, // radius of inner circle corners: 1, // corner roundness (0..1) rotate: 0, // rotation offset color: '#000', // #rgb or #rrggbb speed: 1, // rounds per sec trail: 60, // afterglow percentage shadow: false, // whether render shadow hwaccel: false, // whether utilize hardware acceleration classname: 'spinner', // css class assign spinner zindex: 2e9, // z-index (defaults 2000000000) top: 25, // top position relative parent in px left: 25 // left position relative parent in px }; var target = document.getelementbyid('foo'); var spinner = new spinner(opts).spin(target); </script> </body> </html>

javascript asp.net-mvc

No comments:

Post a Comment