I'm calling a python endpoint method from javascript and when I try to pass in an additional parameter it's only working when the value is a string vs. a variable. This works:
var myData = $.post('{{ url_for("select2ResourceAutocomplete",variable='myValue') }}', function(data) {
});
And I can get the parameter value using keypath = request.args.get('variable')
But if I have it this way it does not work, that is I can't get the parameter value:
var myValue = 'someValue'
var myData = $.post('{{ url_for("select2ResourceAutocomplete",variable=myValue) }}', function(data) {
});
Is there some way to pass the param value as a variable so it can be dynamic?