p5.js load url on click
function setup() {
var the_canvas = createCanvas(640, 360);
the_canvas.parent('thesketch');
}
//
// Draw
//
function draw() {
background(255, 255, 255);
fill(200);
rect(0,0,30,30);
}
function mousePressed() {
if ((mouseX > 0 && mouseX < 30) && (mouseY > 0 && mouseY < 30)) {
location.reload();location.href='http://example.com';
}
}