Export SVG file from p5.js?

My index.html looks like this:

<!DOCTYPE html>
<html lang="en">
  <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.1/p5.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.1/addons/p5.sound.min.js"></script>
    <script src="https://unpkg.com/p5.js-svg@1.3.1"></script>
    <link rel="stylesheet" type="text/css" href="style.css">
    <meta charset="utf-8" />

  </head>
  <body>
    <main>
    </main>
    <script src="sketch.js"></script>
  </body>
</html>

Delete the brackets on your svg script. Your script has src =“[…]”. Needs to be just src=“…” Also that trailing quotation is blue not red. Could be a curly quote if you copy/pasted it. Delete the last quotation and reinsert it off of your keyboard. Both quotation characters should look the same and be the same red color.

If that fails, any way to try it on Safari or Chrome?
.

1 Like