2
votes
Accepted
pset8 - finance - check - ajax - preventDefault()
You have to stop the submission now (in the submit event listener), and in case of success submit in the AJAX callback.
Submitting via JavaScript will not trigger another submit event.
2
votes
Accepted
Access just the text from a db.execute return
Much like you would have seen in the CS50 Finance, db.execute returns a list of dict objects. So just as you accessed the cash value for your index page using rows[0]['cash'] you need to access your ...
1
vote
The Ajax introduced on lecture and in the Shorts Video are very different: will be helpful to know why?
Thanks for the question. That short is no longer relevant to the lecture so we've removed it.
1
vote
my ajax code doesn't seem to be working
There are typos on lines 13 and 15 of ajax.js. 13 should have a # before invdiv, 15 should be ; terminated. It would also be wise to use a snippet for the code inserts as per the video instead of a &...
1
vote
Problem in using API link in fetch command for AJAX
You want to check out the documentation for that api. It can be found here.
According to the documentation, after you get your API Key, you add it to the url as a parameter as such:
https://api....
Only top scored, non community-wiki answers of a minimum length are eligible