Is it possible to save any data produced with sketch on web?

hello, I’m newbie for coding. I use processing mostly for art projects. now I’m working on coding for my friend’s project which is about writing a poem with limited words on web site.
I managed to make sketch which seems like duolingo, but I couldn’t have thought about how to save the resort. at first, I wanted to send email to myself, but there’s some problem. I only used processing and processing.js, so I can’t use more external library or java script.
sending email is not necessary for this project, but I need the resorts(short poems which people wrote) for publication.
I would like to ask any other ways to save or backup the resort. and I’m also considering re-coding everything with p5.js, though I’m not sure if it would take or work properly.(I’ve never used java script or p5.js, and It is all from my mistake that I thought processing can be exported as html5.)
though I will attatch the code later, I made final resorts(words in order including blank and line break) saved in a string.
please help me… I took a project which is upper then my level🥺…

If you’ve already got the basics of your sketch running on a browser you won’t need to re-write everything w/ p5*js.

You can code the email part on a separate JS file and invoke it inside your PDE file.

Both Processing.js (Pjs) & p5*js are JS librares.

Main difference is that Pjs can also transpile PDE files to JS syntax while p5*js can’t.

1 Like

I’m so grateful for big help.
I found that .html which includes processing.js doesn’t work if there is another script. so I’m trying to embed the processing page on another page.
is it possible to get String from other html or script?? this is the page.
(http://kimhankyul.com/waaktaar/waaktaar.html)
I made simple href connected to contact page temporarily, It would be great if the resort string is put on mail body with script.
any advice like mentioning possible references would be great help. so grateful.

Processing.js (Pjs) can mix up w/ other libraries normally.

Take a look at the content of the “index.html” file from this post below which loads “toxiclibs.js” library together w/ “processing.js” and other 2 “.js” files:

2 Likes

thank you, It works perfectly with pde file on server.
so I’m trying to use additional script file, but how can I get String in pde file in new js file?
I tried GetComponent, but it seems like doesn’t work for web…

I can’t figure out what string you’re talking about.

I’m still not good on dealing w/ the browser DOM components.

And I’ve got no idea what you mean by getComponent().

If you need help w/ code you need to post it, preferably a runnable/compilable version of it.

Hosting your attempt running online is even better.

1 Like