We are about to switch to a new forum software. Until then we have removed the registration on this forum.
In html it would be target="_blank" but I need to do it in p5js. Here is my pretty code:
//https://github.com/CodingTrain/Rainbow-Code/blob/master/Tutorials/P5JS/p5.js/8.3_p5.js_what_is_JSON_pt2/birds.json
var data;
function preload() {
data = loadJSON("birds.json");
}
function setup() {
noCanvas();
for (var i = 0; i < data.birds.length; i++) {
createElement('h1', data.birds[i].family);
for (var j = 0; j < data.birds[i].members.length; j++) {
var url = 'https://en.wikipedia.org/wiki/';
url += data.birds[i].members[j];
createA(url, data.birds[i].members[j]);
createP('');
}
}
}
Answers
https://forum.Processing.org/two/discussion/8809/link-function#Item_3
Thanks for your help. I just found another way. I can change line 17 with this:
Indeed your solution is already mentioned in createA()'s reference: :\">
https://p5js.org/reference/#/p5/createA
My link() function is for when we wanna do the same regardless some1 had clicked at anything. :>