Php & p5.js problem


#1

i work on wordpress plugin and p5.js. But i don’t combine php and p5.js . My example codes is under the text.Please help me !

<?php
function information_Collect(){
?>
            <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/p5.js">
            function setup() {
              }
              function draw() {
                ellipse(50, 50, 80, 80);
              }
            </script>
            <?php
    }
    add_shortcode('example','information_Collect');
?>

#2

AFAIK, <script> tags w/ attribute src can’t have JS code embedded inside them. :roll_eyes: