Monday, 13 January 2020

Call Azure function from Javascript

 <script type="text/javascript">
        function CallAzurefunction() {
            debugger;
            var data = {
                'name': 'testazure function'
            };

            var req = new XMLHttpRequest();
            req.open("POST", "AzureFunctionUrl&name=test", true);
            req.setRequestHeader("Accept", "application/json");
            req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
            req.setRequestHeader("crossDomain", true);
            req.onreadystatechange = function () {
                if (req.readyState == 4 /* complete */) {
                    req.onreadystatechange = null;
                    if (req.status == 200) {

                        // alert("Project created");
                    } else {

                        //alert(error.message);
                    }
                }
            };
            //req.send(JSON.stringify(data));

            req.send();

        }
    </script>

No comments:

Post a Comment

Read only field , get latest value from read only field in in power app portal

Below line is used to make field readonly in power app portal through js $( "#bdo_relationshiprole_name" ).parent().css( "po...