Thursday, July 18, 2013

Calling a web service in jquery (sharepoint 2013)

function InfoByDate(){
    var divToBeWorkedOn = "#AjaxPlaceHolder";
    var webMethod = "http://abc:8888/Service.asmx/xyz";
    var txt_CNIC =  replaceAll("-","",$("[title='abc']").val());
    var parameters = "{'abc':'"+ txt_abc + "', 'status':'2'}";
   

    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(msg) { 
        if(typeof msg.d[0] !== "undefined") {
        $("[title='Name']").val(msg.d[0]['az']);
        $("[title='xyz']").val(msg.d[0]['ax']); 
        }
        else
        {
         $("[title='Name']").val("");   
          $("[title='xyz']").val(""); 
        }          
        },
        error: function(e){
           $("[title='Name']").val("");              
        }
    });
}

No comments:

Post a Comment

How to Build interactive Design in Power Pages

 Need to Create a design in figma/or any UX tool Create a Power pages site. Create new Page Open page in VS Code in every page there are the...