I am using jquery to asynchronously post my data to my db using node.js and express.js
Here is roughly what I am doing: index.html: <form id='#mailer' action='/mail/new' method='post'> <input name='mycontent'/> <input type='submit'/> </form>
script.js: $(#mailer).submit(function(e){ e.preventDefault(); $.post('/mailer/new',{mycontent:mycontent}); });
app.js: app.post("/mailer/new,function(){ //insert into database }
So it is essentially submitting to my database but ignoring the e.preventDefault because my page shows the loader wheel when I press submit
via mohammad chughtai
No comments:
Post a Comment