Click here to Skip to main content
15,885,546 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: How can I get an input value from ajax result search Pin
ZurdoDev5-Mar-20 3:50
professionalZurdoDev5-Mar-20 3:50 
GeneralRe: How can I get an input value from ajax result search Pin
vlafratta5-Mar-20 4:54
vlafratta5-Mar-20 4:54 
AnswerRe: How can I get an input value from ajax result search Pin
ZurdoDev5-Mar-20 5:10
professionalZurdoDev5-Mar-20 5:10 
GeneralRe: How can I get an input value from ajax result search Pin
vlafratta16-Mar-20 1:41
vlafratta16-Mar-20 1:41 
SuggestionRe: How can I get an input value from ajax result search Pin
Richard Deeming6-Apr-20 1:30
mveRichard Deeming6-Apr-20 1:30 
QuestionFunction showMessage not available Pin
vinnie moag28-Feb-20 15:04
vinnie moag28-Feb-20 15:04 
AnswerRe: Function showMessage not available Pin
Richard MacCutchan28-Feb-20 22:45
mveRichard MacCutchan28-Feb-20 22:45 
Questiondrawing A Random Bezier Curve 10 times then reset Pin
LarsAlaska28-Feb-20 11:21
LarsAlaska28-Feb-20 11:21 
Here is the code below I am hoping for help on. What I believe ought to happen is ten randomly colored/ shaped lines are successively drawn 1 every 500ms over 5 seconds in the <canvas> box. But all I am getting is a black canvas box.

All "//" and "NOTES" are IMPORTANT!

<html>
<head>
</head>
<body>

<canvas id="myCan" style="background: black;" width=720 height=420>
</canvas>

<script>

var canv = document.getElementById('myCan');
var ctx = canv.getContext('2d');
var t = 500; // time iteration

function draw() { // - - draw
ctx.beginPath();

c1x.canv.width*Math.random(); // bezier control 1 NOTES: original code has height ... so try please with your solutions
c1y.canv.height*Math.random(); // bezier control
c2x.canv.width*Math.random(); // bezier control 2 NOTES: original code has height ... so try please with your solutions
c2y.canv.height*Math.random(); // bezier control
x.canv.width*Math.random(); // random point
y.canv.height*Math.random();
x1.canv.width/2; // mid-point
y1.canv.height/2;

ctx.moveTo(x1, y1); // starting point
ctx.bezierCurveTo(c1x, c1y, c2x, c2y, x, y); // bezier curve
ctx.closePath();

ctx.lineWidth = Math.random()*20;
ctx.strokeStyle = hsl(' + Math.random()*360 + ', 50%, 50%); // color of bezier beam
ctx.shadowColor = 'white';
ctx.shadowBlur = Math.random()*50;
ctx.stroke();
ctx.strokeRect(c1x, c1y, 1, 1);
ctx.strokeRect(c2x, c2y, 2, 2);

}

draw();
setInterval(draw, t); // internal timer

setInterval(function() {ctx.clearRect(0, 0, canv.width, canv.height)}, 10*t);
// 10 shapes, '10*t
// 9 shapes, 9*t etc.

</script>

</body>
</html>

That is all.
Thank you.
AnswerRe: drawing A Random Bezier Curve 10 times then reset Pin
Graham Breach28-Feb-20 19:54
Graham Breach28-Feb-20 19:54 
QuestionThere is some problem in my code I could not get the bus seat layout seats. Please help me Pin
Member 1465358023-Feb-20 22:45
Member 1465358023-Feb-20 22:45 
SuggestionRe: There is some problem in my code I could not get the bus seat layout seats. Please help me Pin
Richard Deeming23-Feb-20 23:01
mveRichard Deeming23-Feb-20 23:01 
QuestionHow does this work in Javascript? Pin
Nand3210-Feb-20 23:25
Nand3210-Feb-20 23:25 
AnswerRe: How does this work in Javascript? Pin
Richard Deeming11-Feb-20 1:09
mveRichard Deeming11-Feb-20 1:09 
GeneralRe: How does this work in Javascript? Pin
Nand3211-Feb-20 1:27
Nand3211-Feb-20 1:27 
QuestionValidate if my drop location is not empty using JS(HTML DnD API) Pin
Member 147327851-Feb-20 20:04
Member 147327851-Feb-20 20:04 
SuggestionRe: Validate if my drop location is not empty using JS(HTML DnD API) Pin
Richard MacCutchan1-Feb-20 21:33
mveRichard MacCutchan1-Feb-20 21:33 
GeneralRe: Validate if my drop location is not empty using JS(HTML DnD API) Pin
Member 147327851-Feb-20 22:41
Member 147327851-Feb-20 22:41 
AnswerRe: Validate if my drop location is not empty using JS(HTML DnD API) Pin
Richard Deeming3-Feb-20 0:53
mveRichard Deeming3-Feb-20 0:53 
GeneralRe: Validate if my drop location is not empty using JS(HTML DnD API) Pin
Nathan Minier3-Feb-20 1:10
professionalNathan Minier3-Feb-20 1:10 
AnswerRe: Validate if my drop location is not empty using JS(HTML DnD API) Pin
ZurdoDev3-Feb-20 2:20
professionalZurdoDev3-Feb-20 2:20 
AnswerRe: Validate if my drop location is not empty using JS(HTML DnD API) Pin
jkirkerx5-Feb-20 12:40
professionaljkirkerx5-Feb-20 12:40 
QuestionPls help!javascript Noobie, Im getting if the average of the array is whole number, why does the method 2 doesn' work? Pin
Member 1472307521-Jan-20 16:36
Member 1472307521-Jan-20 16:36 
AnswerRe: Pls help!javascript Noobie, Im getting if the average of the array is whole number, why does the method 2 doesn' work? Pin
Richard Deeming21-Jan-20 23:52
mveRichard Deeming21-Jan-20 23:52 
QuestionCompare the Triplets | Printing two values. Pin
Manish16918-Jan-20 20:53
Manish16918-Jan-20 20:53 
AnswerRe: Compare the Triplets | Printing two values. Pin
phil.o18-Jan-20 22:09
professionalphil.o18-Jan-20 22:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.