skip to Main Content

How do I combine javascript variables into a object – Jquery ajax

I need to combine all variables in one object: $.get("https://www.virginmegastore.ae/en/gaming/playstation/playstation-games/sonic-forces---ps4/p/714792", function (data) { var productNamePost=$("[name='productNamePost']").val(); var productCodePost=$("[name='productCodePost']").val(); var bg = $('.pdp_image-carousel-image.js-zoomImage-mobile').css('background-image'); var productPrice=$(".price__container > .price__value > .price__number").text(); var url = window.location.href; console.log(url); }); Sorry the question was unclear,i was need…

VIEW QUESTION

Jquery ajax hide element on success request

I am trying to hide a button that i clicked on to upload a image after succesfull upload. this is my code: $(document).on('click', '.upload-image-click', function() { var token = $('input[name="csr"]').attr('value'); var formData = new FormData(); formData.append('image_file', $(this).siblings('input[name=image_file]')[0].files[0]); $.ajax({ url: '/image-upload-ajax/',…

VIEW QUESTION

Checking file size limit – Jquery ajax

i need help in checking file size before uploading file, i want to check the size of file and then continue to upload $("form#data").submit(function(e) { e.preventDefault(); if(this.files[0].size > 2097152){ alert("File is too big!"); this.value = ""; return false; }; var…

VIEW QUESTION

how to filter json data for different key value and creating a new json element using that key values without hard coding data – Jquery ajax

<table> <tr> <th>Net Weight</th> <th>Net Weight Count</th> <th>Difference Average</th> </tr> <tr> <td>5</td> <td>20</td> <td>120</td> </tr> <tr> <td>3</td> <td>3</td> <td>30</td> </tr> <tr> <td>52</td> <td>1</td> <td>123</td> </tr> </table> I have a json data in which i want to filter these data according…

VIEW QUESTION
Back To Top
Search