How could I change text on a page from the backend? This is since I don’t want confidential information to be accessible from the frontend.
Thanks in advance!
Please add details and explain what exactly you’re trying to do.
In the page, you’d do
$w('#someId').text = 'some text';
How would I do that from the backend? Like modify text on a specific page.
Is it possible to do this?
Yes that is possible.
- Send data from backend to frontend (STRING/ARRAY/OBJECT) doesnt’t matter.
- Getting the sent data on frontend and putting it into the element you want.
Process:
- Starting a call (on frontend), to start an exported (returning)-function on backend.
- Sending data with the call to backend (not always neccassary or desired).
- Backend-functions starts and do some process.
- Backend-function sending generated/found-data back to frontend.
- You get the data on frontend.
- Now do what ever you want on frontend with your received data from backend.
The are sometimes questions about, how to recognize if it is a backend-code or frontend-code?
There are 2 indicators which will tell you, if you are on frontend or backend?
-
The first one is not quite exact, but you will find “export function” on backend more often than on front-end.
-
The second one will tell you exactly that you are surely on backend-code, when you recognize, that not even one → $w(‘#…’) <— existing in CODE.
So back to your comment:
In the page, you’d do:
$w('#someId').text = 'some text';