Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
trivedirujuta
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Need help in importing javascript to html

[ Edited ]

Hi,

 

I need to import a javascript function to a file but unable to do it.Can someone please help me?

 

<!DOCTYPE HTML>

<html>

  <head>

    <style>

      body {

        margin: 0px;

        padding: 0px;

      }

    </style>

  </head>

  <body>

   

   

    <script src="testjs.js" type="text/javascript">

    

      var opts = {

  lines: 12, // The number of lines to draw

  angle: 0.15, // The length of each line

  lineWidth: 0.44, // The line thickness

  pointer: {

    length: 0.9, // The radius of the inner circle

    strokeWidth: 0.035, // The rotation offset

    color: '#000000' // Fill color

  },

  colorStart: '#6FADCF',   // Colors

  colorStop: '#8FC0DA',    // just experiment with them

  strokeColor: '#E0E0E0',   // to see which ones work best for you

  generateGradient: true

};

var target = document.getElementById('foo'); // your canvas element

var gauge = new Gauge(target).setOptions(opts); // create gauge!

gauge.maxValue = 3000; // set max gauge value

gauge.animationSpeed = 32; // set animation speed (32 is default value)

gauge.set(1250); // set actual value   

} </script>

  </body>

</html>

 

 

Rujuta Trivedi
Please use plain text.
Developer
Philipk
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Need help in importing javascript to html

[ Edited ]

Is this a joke?

You're not even posting in the webworks section....

<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
</style>
<script type="text/javascript">

var opts = {
lines: 12, // The number of lines to draw
angle: 0.15, // The length of each line
lineWidth: 0.44, // The line thickness
pointer: {
length: 0.9, // The radius of the inner circle
strokeWidth: 0.035, // The rotation offset
color: '#000000' // Fill color
},
colorStart: '#6FADCF', // Colors
colorStop: '#8FC0DA', // just experiment with them
strokeColor: '#E0E0E0', // to see which ones work best for you
generateGradient: true
};
var target = document.getElementById('foo'); // your canvas element
var gauge = new Gauge(target).setOptions(opts); // create sexy gauge!
gauge.maxValue = 3000; // set max gauge value
gauge.animationSpeed = 32; // set animation speed (32 is default value)
gauge.set(1250); // set actual value
</script>
</head>
<body>

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Please use plain text.
Developer
trivedirujuta
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Need help in importing javascript to html

Its not webworks.Its using cascades webview,that's why I have posted here

Rujuta Trivedi
Please use plain text.
Developer
Philipk
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Need help in importing javascript to html

I see, sorry didn't realize.
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Please use plain text.
Developer
trivedirujuta
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Need help in importing javascript to html

I tried a lot to make it working,but couldn;t and that's why posted on forum.Can you help me out

Rujuta Trivedi
Please use plain text.