The following offers a way to submit your subscription form via AJAX. This comes in handy when you’d like to add subscribers without having to reload the page, or send them to the default Campaign Monitor confirmation page.
This AJAX subscribe form uses jQuery and JSON to add subscribers to an existing subscriber list without needing to reload the page. On submission of the form, a subscription request is made from your browser to our servers. We reply with a response which includes details of the subscription result. If submission is successful, we show an alert that says, “Success”. If not, an ‘Error’ alert and reason are displayed. Of course, you can change this behaviour to suit your needs.
Here are some quick steps to get you started:
After you paste in your subscription form, the script should be ready to use. We’ve tried to make this process as easy for you as possible.