I am using Jquery colorbox and flask. When the user hits an icon the script submits a url to render the form inside the colorbox. When the user hits the save button the form is submitted and the colorbox closes. The problem is I just want the box to close, and not reload the screen, although that works fine there is no reason to redraw it. The thing I do not understand is how you return nothing, or do nothing in the view that causes the screen to reload. Here is the view code:
@listings.route('/notes/',methods=['GET','POST'])
def notes( find = None ):
""" Ajax call to handle notes
"""
find = Found.objects.get( pk = find )
if request.method == 'GET':
return render_template('note.html', find = find )
if 'save' in request.form:
find.notes = request.form['note']
find.save()
#return redirect( url_for('listings.landing', search=find.search.pk))
return '',200
The redirect reloads the screen and the return '',200 cause a blank screen. How do I tell flask to do nothing on return?