Wednesday 15 January 2014

javascript - JustGage using asp net -



javascript - JustGage using asp net -

i seek run justgage illustration using asp net, error: "no element id: gauge found ". id correct, wrong.

<script src="/js/justgage.1.0.1.min.js"></script> <script src="/js/raphael.2.1.0.min.js"></script> <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script> var g = new justgage({ id: "gauge", value: 67, min: 0, max: 100, title: "visitors" }); </script> </head> <body> <form id="form1" runat="server"> <div id="gauge" class="200x160px"></div> </form> </body> </html>

we ran same issue. problem script beingness executed before page loaded. there 2 possible solutions that:

1.) set script below <div>

... <body> <form id="form1" runat="server"> <div id="gauge" class="200x160px"></div> </form> <script> var g = new justgage({ id: "gauge", value: 67, min: 0, max: 100, title: "visitors" }); </script> </body>

2.) tell script load after window finished loading using window.onload

<script src="/js/justgage.1.0.1.min.js"></script> <script src="/js/raphael.2.1.0.min.js"></script> <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script> window.onload= function(){ var g = new justgage({ id: "gauge", value: 67, min: 0, max: 100, title: "visitors" }); }; </script> </head> ...

either should trick.

javascript c# asp.net justgage

No comments:

Post a Comment