Relative Content

Tag Archive for jqueryajax

Pass a variable through .ajaxComplete

I have an number of places where I paired a static div with content with an editable field to update that content on a drupal10 site. Using $(div).load(url), I’ve got it working on a single basis like so:

Ajax call is called even if the switch is in off status

I have a bootstrap switch and a jquery script with an ajax call that should start only if the switch is checked. What happen is that, when I load the page the first time everything is fine (the switch is off and the ajax call doesn’t start). If I click on the switch the ajax call works. If I click again to off the switch, the ajax call continue to works. It should stop.
Below you can find the script.
Why this is happening?

jQuery AJAX all of a sudden returning 200 error

I use AJAX all the time and never have a problem. All of a sudden every one of my AJAX calls to a variety of server side PHP pages is returning a 200 error. When I visit the PHP page get_message_list.php directly it is perfectly echoing a JSON encoded array as expected {"msg_count":2}, so I know that is correct. If I change the dataType to “text” to test it just outputs the current page HTML. This just started happening and I have no idea what Im doing wrong?!

jQuery accessing ajax data

I know this has been asked a million times, but I just can’t get this little thing working. I’m using ajax to see if a file exists, via php’s file_exists() and returning the jqxhr object. Ithen use another function to process the .done clause. I can’t seem to get the data back from the second function.