Newbie, can a web app listen to a html page

Hi, I’m new to html and stuff. But a client of mine has asked to have my web app inside his web page, in iFrame. that’s ok. running!

But now he wants to send information from that web page, to my web app.
It is a shopify page, with updated price. This number he wants to get into my app at the right place. (a database…), but how can I get my app to Listen to incoming stuff from that html page ?

hasTageChanged ? I thought that was just for the hashtag for my web-app and not the html page that my app was embedded into via iframe.

anyone ?

i would ask your client how they can provide this data. (there are many ways theoretical)
and then you look if you have this practicable too.
iframe have different sandbox modis, maybe you can read the value via java script from same displayed page.
if a session open you can read a URLParameter.
or doing a https request from within your app.

One of the easiest ways to go is usually HandleURL. Through a virtual directory, you can tap into your app, through a regular web post. I am not familiar with Shopify, though, and I don’t know if it can post to a web site.

If not, it is possible to address HandleURL with URL parameters such as
myapp.com:8080/myDirectory/?Name=John+Smith&address=3+Nightingale+Court&City=Hemet&State=CA&Zip=93123

That will be read in WebRequest.QueryString.

https://documentation.xojo.com/api/web/webapplication.html#webapplication-handleurl

was that HandleURL not outside of a session?
how would you move that data into a user session?

also, they are on two different servers… My app is on Amazon, and the web-site is somewhere else.

You might want to have a look at the HTML5 postMessage interface that could be used to communicate between the iframe and the outer webpage. But you’ll need to get the security policy right which requires access to both servers / apps. I use that quite often the other way around: communicate bi-directionally with a non-xojo app in an iFrame within a Xojo web app. For this I created a custom control with the WebSDK that warps the iFrame with Methods to send and EventDefinitions to receive Messages.

Indeed, handleURL is outside a session. But it can have access to session with WebSessionContext.

It should not be an issue. As long as your app is on the web space, you can address Posts to it.

If data is confidential, you simply need to encrypt it.

OK, so far so good. I got an app running, and from a web-browser I could send stuff.

But, the app, and not sent to a webpage, although it could send directly to the database… but I set it up now with a timer in my app.webPage and did a request for a property in app. When this contained something, I read it and then deleted it after I had used the info… So the web page goes back and read form app.

But what happens if there are to http request coming in the same time (or within the same timeslot I have (timer period of my timer on the webpage).

http requests are queued. So they never come at the same time.