Hi,
rocket version:
rocket = "0.3.15"
rocket_codegen = "0.3.15"
[dependencies.rocket_contrib]
default-features = false
features = ["handlebars_templates", "json"]
I have a button on a page:
<button>generate!</button>
The logic for this button is the following:
When a user clicks on a button, a method is called from the Rust code. This method returns a struct that is displayed on the same page in the <p> </p> field. I have a question: how do I process an onclick event to accomplish the intended. If there are examples somewhere, I will be glad if you share the link. I could not find.
Hi, you could use Ajax for that, e.g. using the fetch API (with JavaScript)
Hi, jens1o.
Your idea is: the handlebars calls some hidden URL in my application via JS script. on that URL, as a response, I will send the struct. And next, I display that struct via Ajax. Correct?
Hi, jens1o.
That work! Thanks!
Great! :)