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

  by abdulwahab on 19-Mar-2020 05:19 pm
Type your comment...Through this post, I know that your good knowledge in playing with all the pieces was very helpful. I notify that this is the first place where I find issues I've been searching for. You have a clever yet attractive way of writing.
  • Reply
  •  1 Like
  •  1 Dislike
  • Report
  by yokyok on 04-Mar-2020 05:08 pm
Type your comment...Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post. nationwide security guard company
  • Reply
  •  1 Like
  •  1 Dislike
  • Report
  by nationwide security guard company on 04-Mar-2020 05:07 pm
Type your comment...Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post.
  • Reply
  •  1 Like
  •  1 Dislike
  • Report