ajax

  1. D

    How to access json from Rest API

    I am returning data from a rest API. I was getting the header along with the json, but as Justin T. pointed out below I needed to add this to my cURL: curl_setopt( $ch, CURLOPT_HEADER, 0); That got rid of the header. Now I am having issue with the returned json and the encoding of it(I think)...
  2. S

    Avoid fatal error on update_checkout event when Calculating Shipping in WooCommerce

    I want to calculate shipping when update_checkout triggered. i used below code in my plugin function function action_woocommerce_checkout_update_order_review($array, $int) { WC()->cart->calculate_shipping(); return; } add_action('woocommerce_checkout_update_order_review'...
  3. M

    Ajax with set Interval OR SignalR

    I have a scenario, where i need check if my Database has received new orders (restaurant). Signalr seems to be the best option. But I can wait 2-3 minutes to update with AJAX. Given this long range I can expect, and thinking of a large scale, would not ajax be better?
  4. W

    How to send file along with some input strings to a webmethod in Codebehind using json Ajax?

    So I have this form that requires the user to fill-up some texts in inputbox, file(eg.docx,pdf etc) and Image (eg.jpg,png etc.), then all data will be send to [Webmethod] in codebehind -and do some process.. Ived successfully implemented the Strings from input box (eg.Title,Discription etc.)...
  5. S

    How to use the data from an AJAX call

    I have the following JQuery AJAX call which successfully returns data from the database - $.ajax({ url : 'get_hashtags.php', type : 'GET', success : function(data){ var obj = jQuery.parseJSON(data); console.log(obj); } }); This is the data returned - (2) [{…}, {…}] 0 ...
  6. R

    How to format Array value from Javascript to Java Servlet using Ajax

    I am in need of your help. I have this array being passed from Javascript to Java Servlet using AJAX. Javascript and AJAX snippet code: var BuildingNo = []; $(xml).find('BUILDING').each(function(){ BuildingNo.push($.trim(this).children('BuildingNo').text()); } The value of BuildingNo...
  7. N

    Ajax response appending in a table

    I am doing a django project where in in ajax, i am calling my function and getting response in array then i am appending those response in my html table. <script> $(document).ready(function(){ $.ajax({ method : 'POST', url : '/home'...
  8. L

    How to update a HTML list with jQuery/AJAX JSON data

    I have a list of ~25 items (and potentially more coming), and an input text field, in which the user can type a keyword, upon which the list should be updated to reflect only items that correspond to that keyword. I would like to use a AJAX call to a PHP file which returns accordingly the...
  9. D

    Symfony 4 Validator with AJAX

    I would like to use the Symfony 4 Validator Component to validate my forms which I send via AJAX to my Controller. The Form is rendered with this method in the Controller: /** * @Route("/profile", name="profile") */ public function profile(Request $request){ $user = $this->getUser()...
  10. R

    Dynamic number of AJAX forms on same page

    I have a payment method page that allows users to delete cards or to set a card as default. I noticed today that when I click a card to delete, it actually deletes another card. I am using AJAX to handle the forms and am not sure the best way to keep these separate as they are dynamic and each...
  11. R

    Is it possible to store Ajax call as an object?

    This isn't necessarily a "how to" question, but rather an ask to help improve upon my own understanding of JavaScript and Jquery. I've been using Jquery a lot lately in my current job and all of my jquery involves a lot of AJAX calls. In several files I have at least 6 ajax calls for different...
  12. N

    Bootstrap dialog box show HTML content in body based on ajax call

    I have the following bootstrap modal dialog box: <div class="modal fade" id="resultModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button"...
  13. R

    How to format Array value from Javascript to Java Servlet using Ajax

    I am in need of your help. I have this array being passed from Javascript to Java Servlet using AJAX. Javascript and AJAX snippet code: var BuildingNo = []; $(xml).find('BUILDING').each(function(){ BuildingNo.push($.trim(this).children('BuildingNo').text()); } The value of BuildingNo...
  14. W

    Ajax XHR returns 500 error, but the PHP file works

    index.html (returns 500 error when running this ajax request) function checkUnread(username) { $.ajax( { type: "POST", url: "http://www.projecttranslation.org/cvlgbt/www/web/unreadcount.php", data: { user: username }, cache: true, success: function ( data ) {...
  15. S

    How to disable button during ajax request

    So I have a razor form and I want to disable a button during ajax request. Also I want to be able to send only one request to controller - (disable any flood attempt) This is my html: <div class="row"> <div class="col-md-8 col-md-offset-2"> @using...
  16. B

    Display Specific data using Ajax and jquery and html select button

    hello community i need help on this what i really want to do is to select from database using onchange() function through Ajax.then return the result to the client.i used Ajax to send the information to the server side and but i am having problem return it with the where condition //this is the...
  17. K

    jQuery live edit table do ajax update and delete, focusout problem

    I want to use jQuery make a table live edit/update/delete , but now has two problems if click the pen by order #3 to #1 , total 3 clicks, but why click the pen by order #1 to #3 total 5 clicks ? click tick icon action won't fire because input box focusout Full code see the demo here...
  18. W

    Passing JSON with functions via AJAX

    Quite simply, I'd like to "re-hydrate" functions which are passed from AJAX, as follows: //AJAX response: {"foo":"bar","baz":"function(){console.log('I am back working as a function!');}"} And obviously, baz should be a function and not a string. How would I do this?
  19. L

    Why my record is not deleted in SQL Server using ASP.NET?

    I am trying to delete records from the database after it deletes the directory. I have a button to delete, once I click the button, it has to call the ajax, then delete the Folder if it exists, Once it delete folder,then delete one record on database Here is my Ajax code: // Delete Folder...
  20. S

    ID received from post - send via ajax

    I would like to read the post id from html and send it via ajax to the controller. How can I get the ID of $ post->id and transfer it via ajax? Or is there a better solution to save the post seen by the user? @foreach ($posts as $post) <div id="post_container_{{$post->id}}" class="row...
Top