JavaScript API - using AJAX
Content
I have the following script, and another script on the cloud that return a value(php - webservice) ( it was tested with other programming languages and it worked), i even executed the $.ajax block in a HTML file outside the cloud, and it worked, i am trying to execute the script when the user tries to save a new contact, but the $.ajax block is not working, i can only see the alert "test" when i click on the save button,what am i doing wrong here?
Version
May 2016Code Snippet
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script type="text/javascript"> var contactExistInfo = []; function onbeforesave() { var contact = window.external.Contact; var contactId = contact.Id; var errorMessage = ""; alert("test"); $.ajax({ url: 'https://azadearnw--tst1.custhelp.com/cgi-bin/azadearnw.cfg/php/custom/checkcontactphone.php', type: 'post', data: {'phone': '3573077', 'code': '00961'}, success: function(data) { alert(data); }, error: function(xhr, desc, err) { console.log(xhr);
0