ajax

Update data in (really) real-time with Javascript

早过忘川 提交于 2020-12-15 09:09:26
问题 hi I want to build a control panel for a web art application that needs to run in fullscreen, so all this panel, that controls stuff like colors and speed values, have to be located at a different window. My idea is to have a database storing all these values and when I make a change in the control panel window the corresponding variable in the application window gets updated too. So, it's basically a real-time update that I could do with AJAX setting a interval to keep checking for changes

fetch() call not returning any data

点点圈 提交于 2020-12-15 07:28:57
问题 I'm having a problem with my fetch() call not working correctly. I have a recursion method that calls itself within this function, but once it passes the if statement, the data itself is not being resolved to the .then() call below. I would like to keep the recursion method within this function. Because the system that this function is calling will change the data.result to a different result that is not null. I just don't know when that will happen, hence that is why I'm using the recursion

fetch() call not returning any data

蹲街弑〆低调 提交于 2020-12-15 07:28:50
问题 I'm having a problem with my fetch() call not working correctly. I have a recursion method that calls itself within this function, but once it passes the if statement, the data itself is not being resolved to the .then() call below. I would like to keep the recursion method within this function. Because the system that this function is calling will change the data.result to a different result that is not null. I just don't know when that will happen, hence that is why I'm using the recursion

AJAX Update DataTable after On Success

心已入冬 提交于 2020-12-15 06:28:18
问题 I have a datatable on userX.php. which has three tabs and each tab contains a table. (table1 table2 and 3) Scenario is there is an action button on each rows in tab 1 and 2, when it is clicked it will move the particular row to the next table / tab using AJAX for preventing page load. below image is the table TABLE using AJAX I would be changing the status column in the table in order to push into the next tab. below is the jquery ajax part $(".changeStatus").click(function(event){ event

Remove url parameter with Ajax when checkbox is unchecked

ぃ、小莉子 提交于 2020-12-15 05:53:56
问题 So basically, I have this code taken from Advanced Custom fields Ressource center: <script type="text/javascript"> (function($) { // change $('#archive-filters').on('change', 'input[type="checkbox"]', function(){ // vars var url = '<?php echo '//' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>'; args = {}; // loop over filters $('#archive-filters .filter').each(function(){ // vars var filter = $(this).data('filter'), vals = []; // find checked inputs $(this).find('input:checked').each

How to select option when after select an option?

一世执手 提交于 2020-12-15 05:09:59
问题 I want to select the option city_id only 2 when after select a country value is = 1 , But I did not successfully. HTML: <select id="country_id"> <option></option> @foreach($countries as $country) <option value="{{ $country->id }}"> {{ $country->name }} </option> @endforeach </select> <select id="state_id"> </select> <select id="city_id"> </select> JS: $(document).on('change', '#country_id', function() { var country_id = $(this).val(); $('#city_id').val('2').change(); }); I see this demo 回答1:

How to select option when after select an option?

寵の児 提交于 2020-12-15 05:09:11
问题 I want to select the option city_id only 2 when after select a country value is = 1 , But I did not successfully. HTML: <select id="country_id"> <option></option> @foreach($countries as $country) <option value="{{ $country->id }}"> {{ $country->name }} </option> @endforeach </select> <select id="state_id"> </select> <select id="city_id"> </select> JS: $(document).on('change', '#country_id', function() { var country_id = $(this).val(); $('#city_id').val('2').change(); }); I see this demo 回答1:

ajax load shortcode in response

时光毁灭记忆、已成空白 提交于 2020-12-15 05:06:43
问题 I have a form in a page-form.php file, on Sumbit i need to send the data to formResult.php to connect to db and get results (products IDs). With Ajax in the form.php file i need to load the products IDs in a shortcode like that : [product id="1, 2, 3"] . form.php part of getting the result from DB : while( $row = mysqli_fetch_assoc($result) ) { echo $row["ID"]; // it does display the IDs in page-form.php echo do_shortcode('[product id="'.$row["ID"].'"]'); // if i add this line, nothing is

How can implement synchronous Ajax call using pure Javascript?

不问归期 提交于 2020-12-15 03:41:33
问题 I need to implement synchronous Ajax calling mechanism. I already implement ajax calling function in my helper same as below : MH.helper = { ajax : function (option) { if(option !== undefined) { for(var opt in option) { this[opt] = option[opt]; } } if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari this.xhr=new XMLHttpRequest(); } else { // code for IE6, IE5 this.xhr=new ActiveXObject("Microsoft.XMLHTTP"); } } } I also implement Ajax prototype as same as below : MH

How can implement synchronous Ajax call using pure Javascript?

一笑奈何 提交于 2020-12-15 03:39:56
问题 I need to implement synchronous Ajax calling mechanism. I already implement ajax calling function in my helper same as below : MH.helper = { ajax : function (option) { if(option !== undefined) { for(var opt in option) { this[opt] = option[opt]; } } if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari this.xhr=new XMLHttpRequest(); } else { // code for IE6, IE5 this.xhr=new ActiveXObject("Microsoft.XMLHTTP"); } } } I also implement Ajax prototype as same as below : MH