how to embed a processing sketch to work on weebly without a server

I really need help to be able to view my processing sketch on a website on Weebly. I even converted my processing code to java but it didn't work when I tried to paste the code into "embed code window" on weebly builder. I think I need to put special code into the body of HTML before and after my processing sketch in order to put the processing sketch there. I am probably doing something wrong. Does anyone know how to do this it would be a huge help for me ? 

2,499 Views
Message 1 of 11
Report
10 REPLIES 10
Square

Can you please post your website and page name you are trying to add the code on? It may also help to post the code so the community can take a look. 

2,481 Views
Message 12 of 11
Report

Thank you very much for your reply. 

this is my weebly website  http://lizaprocessing.weebly.com/

I use Processing for coding, it is built on Java language. Have you heard of Processing?\

Here is an example of Processing code . My code has images ; it is an image array. I have no Idea how to pot it up on the website, but I know it's possible. 

void setup() {
       size(400, 400);
       stroke(255);
       background(192, 64, 0);
}

void draw() {
       fill(200,0,0);
ellipse(150, 25, 19, 19); } 
2,470 Views
Message 12 of 11
Report

Is it possible to put javascript on weebly, if so how ?

2,461 Views
Message 12 of 11
Report
Square

You would probably need to wrap that in <script> </script> tags and put it in an Embed Code element, e.g:

<script>
void ....
void....
</script>
2,450 Views
Message 12 of 11
Report

I'm sorry , that doesnt work. 

This is what I wrote in the embedded code -

<script>
void setup() {
size(400, 400);
stroke(255);
background(192, 64, 0);
}

void draw() {
fill(200,0,0);
ellipse(150, 25, 19, 19);
}

 </script>

2,442 Views
Message 12 of 11
Report
Square

I'm not sure how recently this was written, but a quick Google search found this:

https://cs.nyu.edu/~kapp/cs101/processing_on_the_web/

The src attribute for processing.js would be different, though. You'd need to upload it with a link on a hidden page of your site, then right-click on that link on your live site to get the URL of it from your site.

2,438 Views
Message 12 of 11
Report

where would I put that URL on my site ? 

2,424 Views
Message 12 of 11
Report
Square

What I mean is doing something like this:

1. Add a hidden page to your site called "processing"

2. On that page, add a text element and add some text to it

3. Select a word from it, then make that a link and choose the file option

4. Uploading your processing.js file

5. Publish your site

6. Go to your site then add processing.html on the end so you're viewing the hidden page

7. Right-click the link and copy the URL.

8. Go to Settings > SEO > Header Code, then add this:

<script src="PASTEURLHERE" type="text/javascript"></script>
2,420 Views
Message 12 of 11
Report

Thank you. That works for processing code that doesn't use pictures, but I am using images png format with my processing code ( I have an array of images) 

Is there a place where I will need to upload those pngs on my weebly website ? 

2,297 Views
Message 12 of 11
Report
Square

You could upload those to a hidden page of your site, then copy the image src URL for each of those from the published site.

1,105 Views
Message 12 of 11
Report
This thread has been archived and locked. Please start a new thread if you would like to continue the conversation.