N
N
nano_e_t_42015-11-11 20:48:35
JavaScript
nano_e_t_4, 2015-11-11 20:48:35

How to pass a value to a script?

Hi
guys, plz tell me how to pass the link value to flask? It’s not very easy to do through the form, because the link parameters are formed dynamically.
I did it like this:
<a href="change" onclick = "send(this)">value/а>, but how to further transfer this value to flask from javascript, I can’t find it properly :(
The ajax option is not suitable The
final task is such that when clicking on the link, the value is passed to flask Flask makes a selection from the database, forms a page with forms, in the fields of which it enters the selected values

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
akarin, 2015-11-11
@akarin

Well, there is no way without Ajax.
Is it possible to add this value from javascript somewhere and pull it out via request.

E
Evgeny Svirsky, 2015-11-11
@e_svirsky

<а href="change" onclick = "send(this)" data-some-parameter="value">value</а>

And already in the function itself:
var send = function(scope) {
   var value = scope.data('some-parameter');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question