Jquery .$.ajax is not working

Posted by Saravanan I M on Stack Overflow See other posts from Stack Overflow or by Saravanan I M
Published on 2012-10-05T15:35:46Z Indexed on 2012/10/05 15:37 UTC
Read the original article Hit count: 185

Filed under:
|

I am using $.ajax for facebook invite and calling the url (Yii framework controller). The below code is not working. $.ajax is not working.

function FacebookInviteFriends()
    {
        FB.ui
        ( 
        { 
            method : 'apprequests',
            data: '',
            display: 'dialog',
            title  : 'Invite a Friend',
            message: 'I just sent you an invitation to play My Game.',
            filters: ['app_non_users']
        }, function(response)
        {   
            alert("start"); 
            if (response && response.to) 
            {       
                alert("inside if"); 
                $.ajax({
                    url: 'http://localhost:83/invitechips/createRecord',
                    type: 'POST',                                        
                    data: {id : response.to}                    
                }).done(function() {
                    alert( "Data Saved: ");
                });                               
            }
            else 
            {
                alert("inside else");                 
            }
        }
    );


    }

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX