function myFunction() { var variable1 = "someString" $('#demo').load( "{{ url_for('addshare2', share = '$variable1') }}" ); }