Discussions
AJAX calls to suitelet
Hello,
I am new to scripting so I may have some basic mistakes, I am trying to have an online custom html form send ajax post/get to suitelet for recaptcha 2.0 api verification.
My online Form:
https://forms.na1.netsuite.com/app/site/crm/externalleadpage.nl?compid=1160039&formid=14&h=abe958d8be8debb599b0&redirect_count=1&did_javascript_redirect=T
I cannot get the suitelet to execute, here is my ajax function.
function sendsuitelet(){
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "/app/site/hosting/scriptlet.nl?script=41&deploy=1", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("g-recaptcha-response=pword")
}
And backend SUITELET: