XMPP JavaScript Library

Cakephp isAjax and AngularJS issue

JavaScript, Sachin Puri, 2017-01-31 22:27:29

 

If you are using Angular JS to send AJAX request and Cakephp isAjax function is not considering this request as AJAX then may be this can help you.

In you request add following header


headers:{'X-Requested-With':'XMLHttpRequest'}

Example

$http({method:'GET',url:'http://www.somedomain.com/',headers:{'X-Requested-With':'XMLHttpRequest'}}).success(function(data){

    //Write your code here to handle response data

}}]);

 

Add Your Comment
   
    Yes! I want to receive all comments by email

No Comments Posted Yet. Be the first one to post comment