How to run a javascript function on the server side?

Asked

Viewed 349 times

0

On the server side:

return JavaScript("Callback()");

On the client side:

function Callback(){
  //
}

The result is displayed as "Callback()" on the web page, I took the example here.

Some solution ?

  • Javascript does not interact directly with back-end and front-end, or runs on the front end or runs on the back end (with interpreters like Node.js or the like), direct communication will never be possible, WEB is HTTP, that is is request and response, containing payload (POST, PUT) or not.... What exactly do you want to do? Because there are strategic solutions for every case that can suit you, but.

  • @Guilhermenascimento this is the idea: The site sends an email to confirm the account, after clicking a "confirm" button, redirects to the main page and show a modal saying it has been confirmed success. I don’t want to create another view or an html page saying it’s been confirmed, I just want to show a modal.

  • You can use a session to say that it has been sent or you can use the querystring parameter for an IF to inform the View that it should display the modal on the following page.

  • @Guilhermenascimento because I didn’t think of it ? What anger , thank you.

  • 1

    Imagine, a good night/

  • @Guillhermenascimento

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.