-
Hijack form action & interact with page using jQuery
To create a widget that takes a user’s input of Postcode, compares it against an array of postcodes, and acts on the page telling the user whether their postcode is valid or not, you can start with the following code: <div id="MyForm"> <form method="POST" name="info-form"> <input type="hidden" value="/form-sent" name="returnURL" /> <label for="First Name">First Name: </label>…
-
AJAX loading JS, CSS, and HTML
Having problems loading scripts and CSS when loading content with AJAX? The solution is simple: Don’t have the JS or CSS in the pages you load up with JavaScript. Instead, when you load up the HTML with your AJAX call, also call the scripts and CSS you need separately at the same time. After including…