ajax

JavaScript jQuery delay oninput

元气小坏坏 提交于 2021-01-20 11:21:15
问题 I have a html table which gets its values from a database through jQuery Ajax. Something like this <div id="tableId"></div> Than the java script: function showUser(rowsToShow) { request = $.get("showTableFunction.php", { q: rowsToShow }); request.done(function(response, textStatus, jqXHR) { $("#tableId").html(response); }); request.fail(function(jqXHR, textStatus, errorThrown) { console.log("The following error occurred: " + textStatus, errorThrown); }); } The table has a oninput function

Send file to PHP server with JS

感情迁移 提交于 2021-01-20 08:38:59
问题 I can send files from the browser to the server using drag'n'drop and this code simply works fine: var temp = new FormData(); temp.append("file_content",e.originalEvent.dataTransfer.files[0]); //Ajax POST here... Then I make a POST request (Ajax) to send that file to PHP and PHP can manipulate that file using $_FILES[file_content] . Easy. My problem is that sometimes the user drops a folder and I already can manipulate the files inside that folder with JS in order to send them via Ajax. My

Send file to PHP server with JS

ぃ、小莉子 提交于 2021-01-20 08:37:08
问题 I can send files from the browser to the server using drag'n'drop and this code simply works fine: var temp = new FormData(); temp.append("file_content",e.originalEvent.dataTransfer.files[0]); //Ajax POST here... Then I make a POST request (Ajax) to send that file to PHP and PHP can manipulate that file using $_FILES[file_content] . Easy. My problem is that sometimes the user drops a folder and I already can manipulate the files inside that folder with JS in order to send them via Ajax. My

Send file to PHP server with JS

佐手、 提交于 2021-01-20 08:36:25
问题 I can send files from the browser to the server using drag'n'drop and this code simply works fine: var temp = new FormData(); temp.append("file_content",e.originalEvent.dataTransfer.files[0]); //Ajax POST here... Then I make a POST request (Ajax) to send that file to PHP and PHP can manipulate that file using $_FILES[file_content] . Easy. My problem is that sometimes the user drops a folder and I already can manipulate the files inside that folder with JS in order to send them via Ajax. My

YII2 Active Form show custom validation message

蓝咒 提交于 2021-01-07 06:31:30
问题 I have login form which, where I am implementing 2 Factor Authentication integrating twilio API. The API is working fine and I can get the verification response for success or failure. Now I am somehow not able to display the message "OTP verification Failed" on the form. here is my controller code: public function actionLogin() { $this->layout = '@app/themes/backend/login'; $model = new LoginForm(['scenario' => 'login']); if (Yii::$app->request->isAjax && $model->load($_POST)) { $authy_id =

Dynamically update dropdown based on previous selection with PHP PDO

穿精又带淫゛_ 提交于 2021-01-07 06:21:56
问题 This has been answered before, however I'm asking again for two reasons: I can't find any resources that utilize PDO, and regardless of that, all of the ones I've found consist of code without any comments or explanations, which makes it hard to interpret and adapt them to my use case. I need to be able to make a dropdown dynamically update itself based on the selection of the previous one, and if I change that selection, it should re-update itself without having to submit the form or reload

Dynamically update dropdown based on previous selection with PHP PDO

て烟熏妆下的殇ゞ 提交于 2021-01-07 06:15:39
问题 This has been answered before, however I'm asking again for two reasons: I can't find any resources that utilize PDO, and regardless of that, all of the ones I've found consist of code without any comments or explanations, which makes it hard to interpret and adapt them to my use case. I need to be able to make a dropdown dynamically update itself based on the selection of the previous one, and if I change that selection, it should re-update itself without having to submit the form or reload

wait for Promise.all in a synchronous function, basically blocking! javascript

北城以北 提交于 2021-01-07 03:28:47
问题 I have alot of syncrhounous functions that i want to execute before that are basic ajax requests, these request will render html to the DOM. In order to do this i had to execute all of this synchrounous requests one by one. But i somehow want to these synchrounous functions asynchrounous all at the same time and wait for them to finnish in order to speed things up. This has to happen inside a synchrounous function. But my understanding is that this doesnt work in javascript, but i would like

wait for Promise.all in a synchronous function, basically blocking! javascript

冷暖自知 提交于 2021-01-07 03:28:31
问题 I have alot of syncrhounous functions that i want to execute before that are basic ajax requests, these request will render html to the DOM. In order to do this i had to execute all of this synchrounous requests one by one. But i somehow want to these synchrounous functions asynchrounous all at the same time and wait for them to finnish in order to speed things up. This has to happen inside a synchrounous function. But my understanding is that this doesnt work in javascript, but i would like

wait for Promise.all in a synchronous function, basically blocking! javascript

和自甴很熟 提交于 2021-01-07 03:28:03
问题 I have alot of syncrhounous functions that i want to execute before that are basic ajax requests, these request will render html to the DOM. In order to do this i had to execute all of this synchrounous requests one by one. But i somehow want to these synchrounous functions asynchrounous all at the same time and wait for them to finnish in order to speed things up. This has to happen inside a synchrounous function. But my understanding is that this doesnt work in javascript, but i would like