skip to Main Content

How to POST two parameters in PHP using Ajax – Jquery

I want to pass two parameters into the function getStuName() but found that there is error. Can anyone help me with the syntax? <script language="javascript"> function getStuName1(val, val1) { if(val!=''){ $.ajax({ type: "POST", url: "get_stuname1.php", data:'yr='+val+'&classname='+val1, success: function(data){ $("#stu-list1").html(data); }…

VIEW QUESTION

Laravel – AJAX file upload returning null

This is my ajax request: var files = $('#imgur_attach')[0].files; if(files.length > 0){ var fd = new FormData(); // Append data fd.append('file',files[0]); fd.append('_token',$globalToken); $.ajax({ type: "POST", dataType: "json", contentType: false, processData: false, url: host + "/attach-comment-image/" , data: {fd}, Controller: public…

VIEW QUESTION
Back To Top
Search