I am trying to write a JS code that will cancel the “btn_submit” buttons .onclick event if the given number already exists in the database. I use AJAX to query the DB for the given number and to determine if the should send the data to a .php site which will upload the question. To determine this I need the
Tag: ajax
Solve Cross Origin Resource Sharing with Flask
For the following ajax post request for Flask (how can I use data posted from ajax in flask?): I get a Cross Origin Resource Sharing (CORS) error: I tried solving it in the two following ways, but none seems to work. Using Flask-CORS This is a Flask extension for handling CORS that should make cross-origin AJAX possible. http://flask-cors.readthedocs.org/en/latest/ How to
Why does Bootstrap Collapse keep removing the “collapse” class after expanding?
I am using jQuery Collapse on an element that’s inserted via Ajax. When I apply the line below, it removes the collapse class. I need the class to remain so I can call collapse(‘hide’) when the Ajax content needs to be closed. Here’s what I have in my .php file: Here’s what it ends up with after the jQuery is
How can I stop all the currently ongoing Ajax queries that DataTables instance have started?
Brief Description Resetting a test server to a known state causes my tests to fail due to Ajax requests launched by DataTables instances being ongoing at the time the server is reset. I’d like to prevent this by stopping the DataTables requests before the server is reset. Detailed Description I have an application in which I use DataTables on some
Call wrapper function from inside jQuery AJAX complete function
This is what I’m attempting to do, but I’m getting an error that I can’t bind to undefined, I assume because I’m in an anonymous function. I need to access the method (getAndSayHi) the AJAX call is in. How can I achieve this? Answer Try
jquery bootstrap selectpicker refreshing lists based upon previous list choice
I have three drop down lists, one list is populated on page load and doesn’t change. The 2nd and 3rd lists may change depending on the selection. This functionality is working fine. I have tried to add Bootstrap selectpicker to the selectors and I can see it is working – unfortunately the lists are not refreshing based upon the selection.
Using AngularJS for Ajax POST in Struts 1
I’m trying to send Ajax POST using Struts action form. I’ve succeeded to create this kind of call using jQuery. ActionForm: Action: jQuery Ajax POST (working): AngularJS Ajax POST (not working): for some reason AngularJS doesn’t like the way I’m sending the ActionForm data. Answer It is not data that you should use, but params :
Windows.history.back() + location.reload() jquery
I’ve a probleme in my code. The aim is to complete a simple form, then you click on a submit button. It do an Ajax resquest to go in the method. On success in the ajax request, i use windows.history.back() to go to the previous page ans here i want to refresh this page, to refresh values which are modificated
How to store a SQL result in a JavaScript array, using AJAX and JSON
I want to retrieve a table from an SQL database dynamically into an array using JavaScript. The code below works fine if I use a global JavaScript variable for the array. But I would like to pass the array the data is to be stored in dynamically as well. That is where the problem begins. My source: The custom array
Bootstrap3 toggle switch with ajax update to mysql
Hello and thank you for looking. I have the slick new toggle effect for the checkbox (boostrap3) in place. I would like to update my database each time the toggle is clicked. A simple On or OFF entry will be perfect. Ofcourse it needs to be without a page refresh. HTML: Javascript/Ajax: (I added a div to show my results)