
- To ignore remote changes and overwrite them
git push origin --force
- The token conveyor belt: use hidden input fields to pass ‘info’ between POST & GET requests (if there is no user entered info into an input field which can be ‘gotten’ through req.body).
Use case: in script.js assign the value of an element’s “innerHTML” property to be the value of a hidden input. This is useful if the innerHTML property’s value is dynamic and depends on some prior user action:
In index.ejs:
<input type="hidden" name="amount value ="" id="checkoutinput>
In script.js:
var checkoutinput = document.getElementById("checkoutinput");
checkoutinput.value = cart.grandTotal.toFixed(2);