Created
December 10, 2015 03:13
-
-
Save rickydazla/45a3c719cfb498997d7b to your computer and use it in GitHub Desktop.
Shopify AJAX Form submit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Build the Shopify Parameters | |
//---------------------------------------*/ | |
var action = '/contact?'; | |
action += encodeURIComponent('form_type') +'='+ encodeURIComponent('contact'); | |
action += '&'+ encodeURIComponent('utf8') +'='+ encodeURIComponent('✓'); | |
action += '&'+ encodeURIComponent('contact[email]') +'='+ encodeURIComponent(contact_email); | |
action += '&'+ encodeURIComponent('contact[body]') +'='+ encodeURIComponent(contact_body); | |
/* Submit the form | |
//---------------------------------------*/ | |
$.ajax({ | |
type: "POST", | |
async: true, | |
url: action, | |
error: function(jqXHR, textStatus, errorThrown) { | |
// Request Failed. | |
}, | |
success: function(response) { | |
// Assume Success. 'response' is the complete HTML page of the | |
// contact success form, so likely won't be helpful | |
self.submit_thankyou(); | |
} | |
}); |
@luukee the form's action value
/contact?form_type=customer&utf8=%E2%9C%93&contact%5Bemail%5D=&contact%5Btag%5D=new%20year%20subscribe
why Status Code: 429 ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What does the '/contact?' action refer to?