Simple ajax example for Flask
Steps
- Edit a test.html. ```html
test
2. Edit the server file.
```python
@bp.route('/parking')
def parking():
#ajax test
db = get_db()
data = db.execute(
'SELECT event_time,plate_number,occupancy_status,parking_space_no,device_ip_address'
' FROM parking'
' ORDER BY event_time DESC'
).fetchall()
result="Hey, I saw that! You clicked at".format(datetime.datetime.now())
count=28
print (data)
return jsonify(result=count)