skip to Main Content

Jquery to javascript. Post request

Friends, I'm converting Jquery to javascript and I'm having problems with this block of code: $.post('ajax_data',{action:'service_price',service:service,quantity:quantity,dripfeed:dripfeed,runs:runs}, function(data){ $("#charge").val(data.price); $("#dripfeed-totalquantity").val(data.totalQuantity); }, 'json'); I tried to do this, but it doesn't work for me const request = new XMLHttpRequest(); const url =…

VIEW QUESTION

How to pass this array from Laravel Controller via AJAX and create a button base on data

First I choose Color button: <form class="form form-variant"> {{ csrf_field() }} <button type="submit" class="btn btn-success checkbox_click" id="colorChange" style="colors: purple !important"> Color </button> </form> My javascript <script type="text/javascript"> $(document).ready(function(){ $('#myForm{{$skuItemVariant_colorJs->SkuColorId}}').submit(function(e){ e.preventDefault(); $.ajax({ url: "{{ url('product-detail/getsize') }}", type: "POST", data: $('.form-variant{{$skuItemVariant_colorJs->SkuColorId}}').serialize(), success:…

VIEW QUESTION

Ajax success data show undefind – Jquery

I return a array object data Ajax success result then i print li tag but its show undefind My Ajax code is $.ajax({ 'method': 'GET', 'url': base_url +'party/selectCities?id='+state, success: function(data) { var newData = data.replace(/"/g, "") if(newData == ""){ }else{…

VIEW QUESTION

Data pass to codeigniter to ajax the function not working – Jquery

I try to pass a data code igniter controller to ajax request the written function not working Controller public function selectPlaygrounds() { $data = $this->branchatm->getCitiesFromState($state); $result=''; if($data){ foreach($data as $list){ $result.="<li ng-click='sawAll($list->city);'>$list->city</li>"; } } sendJsonResponse($result); } Ajax call $.ajax({ 'method':…

VIEW QUESTION
Back To Top
Search