Relative Content

Tag Archive for javascriptjqueryajax

Ajax call every some seconds

I have a problem with my script, i want to do a POST call, to a script file.php, and then call the file2.php every 10000 seconds until timeout when (1800000 seconds pass) OR return the response we want and clear the timeout and output the info

jQuery Chat – Scroll to the bottom

I have a script that scrolls to the bottom of the messages div when it loads the chat or when a new message is sent. I was checking if the user was already at the bottom of the div because if it is not… I don’t want to push it to the bottom of that div every time the system checks for a new message but I can’t get this to work… why? When the system reloads the messages… the user is no longer at the bottom of the div so it doesn’t scroll automatically..

Do a post call depend on datatable value

I have my dataTable script below working and bringing data very well, but i want to perform some tasks. like when i click the button the post call for ajax get executed

JavaScript nested AJAX calls and promises how to chain correctly?

I am stuck at setting the proper order of execution for following. Suppose, i need to make an AJAX call, then process the data and store it in IndexedDB. I use idb-keyval lib for that, which operated on promises. Then, based on the data content, i need to make another AJAX call to get some dependent data and also store it in IndexedDB. Then, i have to trigger final data processing for the document. For that I try to use ajaxStop event, which would trigger when all AJAX calls are completed. However, the order of the processing is not as expected. The ajaxStop event fires when the main AJAX call is finished without waiting for the child call to complete. Then, it fires again when sub-call is completed.