I have very little knowledge in this area but I need to implement this.
How would I execute this code from a juce application and return the response.success into variable.
Note: #serial key, #serial_key_uuid, #sku are set in the aplication of course
<script type="text/javascript">// <![CDATA[
jQuery(function(){
jQuery("input#validate").on("click", function(){
jQuery.ajax({
url: "http://someaddress.com/?wc-api=validate_serial_key",
type: "post",
dataType: "json",
data: {
serial: jQuery("input#serial_key").val(),
uuid: jQuery("input#serial_key_uuid").val(),
sku: jQuery("input#sku").val()
},
success: function( response ) {
jQuery("p#result").text('');
if ( response.success == "true" ) {
jQuery("p#result").append( '+response.message+'.' );
} else {
jQuery("p#result").append( ''+response.message+'.' );
}
}
});
});
});
// ]]>
