Quick Ajax
Copy Below Code
View As A Text File
Show Text Only
Show API
Edit Code
PHP response
echo mod_repsone(false,'Error Message');exit;
//Custom Ajax ....
https://www.gen.fastcodings.com/gen_code/231
//Laravel Controller Validation
https://www.gen.fastcodings.com/gen_code/689
//Ajax Link:
http://api.fastcodings.com/js/ajax.js
https://docs.google.com/spreadsheets/d/1RNLNns4Z1KAPRVO00RUfSihlZbikhyR-mjTr-oFIdcs/edit#gid=2067623577
function edit_form_order(){
quick_ajax_post(
base_url_admin + contr + '/pop',
{ typ:'project_id'},
function (FuncParamArr,obj) {
//alert(obj.html);
quick_popup(obj.title,obj.html);
}
);
}
//POST complete Form.....
function page_form_submit() {
cbfunc = function(){
$("#num").val('');
alertme('<i class="fa fa-check" aria-hidden="true"></i> Form has been submitted successfully ! ','success',true,3000);
};
return postMyFormMain('{{route('assign_number.store')}}',$("#actionForm").serialize(), cbfunc, [], 'POST') ;
}
//GET/Post Some Values
function delete_number(idd) {
var idd = $("#delete_number").val();
cbfunc = function(){
$("#select_package_id option:selected").attr('data-price',$("#upd_price").val());
$("#delete_number").hide();
alertme('<i class="fa fa-check" aria-hidden="true"></i> Phone has been deleted successfully ! ','success',true,3000);
};
return postMyFormMain('{{base_url()}}adminpanel/assign_number/delete_number', {id:idd}, cbfunc, [], 'GET') ;
}
//Post Data Not whole form submit
postMyForm(
baseURL+'getloc',
{lat:position.coords.latitude,lng:position.coords.longitude, _token:$("meta[name=csrf-token]").attr("content")},
function(){
//obj.errormsg or which is getting from ajax can be used here.
alertme('<i class="fa fa-check" aria-hidden="true"></i> Updated Successfully ','success',true,1500);
}
);
//Submit whole form
submitMyForm(
baseURL+'member/post_mail',
function(){
$("#frm")[0].reset();
alertme('<i class="fa fa-check" aria-hidden="true"></i> Email has been sent successfully ','success',true,3000);
}
);
//For new element render
$(document).on('click', '.elementClass', function() {
//CODE HERE
});