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:
function googleapiverify(request, response)
{
if (request.getMethod() == 'GET' )
{
if (request.getParameter('g-recaptcha-response' ) != null )
{
var testvar = "true"
response.write(testvar);
}
else
{
response.write('none found' );
}
}
}
And my response:
<tr><td class=text><img src='/images/5square.gif' width=5 height=5>Invalid page parameter. Unable to view page.</td></tr> Does anyone have any examples of sending ajax post or get to a suitelet backend app?