I want to retrieve the data from the variable 'clicked' so I can use it in SQL queries in Flask.
JQuery
$(document).ready(function(){
var clicked;
$(".favorite").click(function(){
clicked = $(this).attr("name");
$.ajax({
type : 'POST',
url : "{{url_for('test')}}",
data : clicked
});
});
});
Flask/Python
@app.route('/test/', methods=['GET','POST'])
def test():
return render_template('test.html')