Click here to Skip to main content
15,169,823 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Uploading image using JQuery AJAX Pin
Alex Dunlop10-Nov-21 23:14
MemberAlex Dunlop10-Nov-21 23:14 
GeneralRe: Uploading image using JQuery AJAX Pin
Richard Deeming10-Nov-21 23:17
mveRichard Deeming10-Nov-21 23:17 
AnswerRe: Uploading image using JQuery AJAX Pin
jkirkerx16-Nov-21 14:50
professionaljkirkerx16-Nov-21 14:50 
GeneralRe: Uploading image using JQuery AJAX Pin
Richard Deeming17-Nov-21 1:46
mveRichard Deeming17-Nov-21 1:46 
GeneralRe: Uploading image using JQuery AJAX Pin
jkirkerx17-Nov-21 7:18
professionaljkirkerx17-Nov-21 7:18 
Questionhow do you paint objects with two different colors in the for repetition structure Pin
Member 1541326530-Oct-21 4:38
MemberMember 1541326530-Oct-21 4:38 
AnswerRe: how do you paint objects with two different colors in the for repetition structure Pin
Richard MacCutchan30-Oct-21 5:25
mveRichard MacCutchan30-Oct-21 5:25 
GeneralRe: how do you paint objects with two different colors in the for repetition structure Pin
Member 1541326530-Oct-21 10:07
MemberMember 1541326530-Oct-21 10:07 
var book = {
title: "The Giver",
stars: 4
};

// draw shelf
fill(173, 117, 33);
rect(0, 120, width, 10);

// draw one book
fill(214, 255, 219);
rect(10, 20, 90, 100);
fill(0, 0, 0);
text(book.title, 15, 29, 70, 100);
for (var i = 0; i < book.stars; i++) {
image(getImage("cute/Star"), 13 + i * 20, 90, 20, 30);
}

for (var i=0; i<2; i++){
var xLivrosElias = [150];
var Autor = "Elias Araujo";
var recomendarlivro1 = true;
var recomendarlivro2 = true;
var recomendarlivro3 = false;
var count = i;
var cout = i[1];

rect(xLivrosElias[0]+150*i,20,90,100);

//Autor do tres Livros
fill(0, 0, 0);
text(Autor,15+140,29+60);
text(Autor,15+290,29+60);
text(Autor,15+1,29+60);
//Titulo do Livros 
//2Livro
text("O guardião",15+290,29+30);
//3 Livro
text("O assasino do Futuro",15+140,29+10,100,30);

if(recomendarlivro1 === true){

    text("O livro e bom",25,100);
}else{

    text("O livro e ruim",25,100);
}
if(recomendarlivro2 === true){

    text("O livro e bom",315,89);

}else{
    text("O livro e ruim",315,89);
}
if(recomendarlivro3 === false){

    text("O livro e ruim",165,89);
}else{

    text("O livro e bom",165,89);
}

if(count ===0){
    fill(196, 68, 68);
}else{
fill(156, 97, 97);
}

}
//Segunda estante de livros

fill(173,117,33);
rect(0,250,width,10);

var autor= "Alexandre";

//draw book one

//book one
fill(140,89,89);
rect(140-130,50+100,90,100);
//autor
fill(0, 0, 0);
text(autor,20,240);
//nome do livro
text("Isadora 1 O incio",20-5,240-80,90,45);

//livro 2
fill(147, 198, 230);
rect(140+20,150,90,100);
//autor
fill(0,0,0);
text(autor,20+150,240);
//nome do livro
text("Isadora 2 a procura do Rei",165,240-80,90,45);

//livro 3
fill(46,209,62);
rect(140+160,150,90,100);
//autor
fill(0,0,0);
text(Autor,20+290,240);
//nome do livro
text("Isadora 3 a consquista de 

um novo Reino",305,240-80,90,40);

Richard, I still don't understand why I painted only book 3, book 2 is blank, could you say where I'm wrong to fix it
AnswerRe: sytax error unexcepted token Pin
OriginalGriff5-Oct-21 22:20
mveOriginalGriff5-Oct-21 22:20 
GeneralRe: sytax error unexcepted token Pin
Richard Deeming5-Oct-21 22:44
mveRichard Deeming5-Oct-21 22:44 
GeneralRe: sytax error unexcepted token Pin
OriginalGriff5-Oct-21 22:52
mveOriginalGriff5-Oct-21 22:52 
Questiondata import via API Pin
Francesco Reboldi23-Sep-21 20:28
MemberFrancesco Reboldi23-Sep-21 20:28 
AnswerRe: data import via API Pin
Afzaal Ahmad Zeeshan24-Sep-21 0:47
mveAfzaal Ahmad Zeeshan24-Sep-21 0:47 
GeneralRe: data import via API Pin
Afzaal Ahmad Zeeshan24-Sep-21 5:11
mveAfzaal Ahmad Zeeshan24-Sep-21 5:11 
GeneralRe: data import via API Pin
Francesco Reboldi24-Sep-21 6:13
MemberFrancesco Reboldi24-Sep-21 6:13 
GeneralRe: data import via API Pin
Francesco Reboldi25-Sep-21 7:26
MemberFrancesco Reboldi25-Sep-21 7:26 
QuestionRegex not keeping the . or decimal with currency value with keydown event. Pin
jkirkerx23-Sep-21 10:06
professionaljkirkerx23-Sep-21 10:06 
AnswerRe: Regex not keeping the . or decimal with currency value with keydown event. Pin
Member 1532961323-Sep-21 10:32
MemberMember 1532961323-Sep-21 10:32 
GeneralRe: Regex not keeping the . or decimal with currency value with keydown event. Pin
jkirkerx23-Sep-21 10:39
professionaljkirkerx23-Sep-21 10:39 
GeneralRe: Regex not keeping the . or decimal with currency value with keydown event. Pin
Member 1532961324-Sep-21 2:07
MemberMember 1532961324-Sep-21 2:07 
AnswerRe: Regex not keeping the . or decimal with currency value with keydown event. Pin
jkirkerx29-Sep-21 13:19
professionaljkirkerx29-Sep-21 13:19 
GeneralRe: Regex not keeping the . or decimal with currency value with keydown event. [Perhaps Solved] Pin
jkirkerx29-Sep-21 14:18
professionaljkirkerx29-Sep-21 14:18 
QuestionHow does the compare function work with numerical sort? Pin
Ryan Blake 202126-Aug-21 16:51
MemberRyan Blake 202126-Aug-21 16:51 
AnswerRe: How does the compare function work with numerical sort? Pin
Peter_in_278026-Aug-21 19:22
professionalPeter_in_278026-Aug-21 19:22 
GeneralRe: How does the compare function work with numerical sort? Pin
Ryan Blake 202128-Aug-21 14:45
MemberRyan Blake 202128-Aug-21 14:45 

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.