javascript - Jquery ajax call for generate authorization code -
as part of requirement, generate authorization code calling o365 url jquery ajax call. calling below script document ready()
$.ajax({ type: 'get', datatype: 'jsonp', async: false, url: 'https://login.microsoftonline.com/{{tenant id}}/oauth2/authorize?client_id={{client id}}&response_type=code&redirect_uri=https://myurl.com/createpage/&response_mode=query&resource={{resource}}&state=9128', crossdomain: true, success: function(jsondata) { alert(jsondata); }, error: function(request, textstatus, errorthrown) { console.log(errorthrown); }, cache: false });
but getting following error. jquery ajax error
request on resolving issue.
you should check content of response in tab network (in dev tools).
i guess response not valid json, parsing failed (your specified jsonp type in ajax call)
Comments
Post a Comment