Pass data from jQuery to PHP for an ajax post

后端 未结 3 2006
闹比i
闹比i 2020-11-29 09:45

Hello I am a newbie working with jQuery and Ajax. I am trying submit data to the server using Jquery POST method. And the data that I am passing is a string. Now I am unable

3条回答
  •  一向
    一向 (楼主)
    2020-11-29 10:28

    //javascript
    if(step==1)
    {
       var data = {'MyFieldName':document.getElementById('hiddenContact').value};
       $.post('/callcenter/admin/postContacts', data, function(returnData){
          alert('The server said ' + returnData);
       });
    }
    
    //read the post in php
    
    

提交回复
热议问题