Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

68
Views
how to set an image using a url from a data set on code.org

i have a program that takes info from a data set about birds and it will show a random bird and its info based on a random number that's generated I have everything down except the image part

I tried using

setImageURL("birdInfoImage",birdImage[index]);

in a function but an error appeared saying "setImageURL() url parameter value (undefined) is not a string"

Edit: this is for a homework assignment on code.org. The picture should be taken from the data set in the site in the "image of bird" column

var birdImage = getColumn("100 Birds of the World", "Image of Bird");

then I used bird image in a function to use the URL of the image in the data set and set that URL as the image

 onEvent("initiateButton","click",function(){
  var index = getNumber("randomNumberOutput");
  setText("birdInfoName", reducedBirdList[index]);
  setText("birdInfoScientificName", reducedBirdList[index]);
  setText("birdInfoColor", PrimaryColor[index]);
  setText("birdInfoDiet", birdDiet[index]);
  setImageURL("birdInfoImage",birdImage[index]);

hope that helped

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!