Questions tagged [ajax]

60672 questions
0

votes
0

answer
27

Views

Pull data from database using AJAX on html form multi select

I have 3 columns in my database table, viz. name, category, city. Here is the link where the form is located : http://sms.thetelityellowpages.com/sms/send.php There in category and city are multi select fields which are being pulled by database. Now the actual issue is that when I select 2 categori...
0

votes
0

answer
18

Views

Getting POST API to work with ajax using JavaScript

I'm trying to reach an API from inside my tag manager. The language to use for the so-called building blocks in this tag-manager is JavaScript. The POST API I am trying to use is fully functioning and works like this: input: {'features': 'xyz'} output: [0.45] I set up an ajax statement, but it does...
T.Beil
1

votes
2

answer
879

Views

Ajax and async await

I am a bit confused as to why my ajax call doesnt return a result. I thought a method defined as async automatically returns a promise. What am I doing wrong? async AjaxCall(filePath) { let xhttp = new XMLHttpRequest(); xhttp.open('POST', filePath, true); xhttp.setRequestHeader('Content-type', 'appl...
Asperger
0

votes
0

answer
17

Views

First AJAX always happens before last nested AJAX done

I'm using nested AJAX. I disable button before all AJAX calls then enable button within .always in outermost AJAX. But the problem is that I think code to enable button happens before code within .done of innermost AJAX. Is it because the .always in outermost AJAX runs in parallel to .done in innerm...
Ben Kao
1

votes
2

answer
62

Views

Asynchronous AJAX return after page loads

I'm using Spring MVC and I need to make an asynchronous call to the server only once when the JSP page has loaded completely. What I actually have is a Controller that returns a List. I call the Controller using AJAX. The problem with my solution is that I'm not able to get the data of List after lo...
1

votes
2

answer
81

Views

JSON string from server side not coming properly using ajax jquery

What I am doing is, i am getting data from server side using mvc. The data is properly coming in return part. But when I m debugging in the client side, I am only getting the parameter value as [. Below is the JSON response which I am getting. [{'VENDORNAME':'ABC','VENDORCODE':'1234'},{'VENDORNAME':...
B N
1

votes
3

answer
44

Views

Display counted records from partial

I have a ruby application in which I have post and like models. I want to be able to click a like button and then refresh the number of likes for the post. For that I'm using ajax. My question is how I can count the likes for the post in my partial html document. At the moment the code in my _show....
flo3719
1

votes
1

answer
39

Views

Why my ajax function are not working on infinite scrolling?

I am building a webpage having infinite scroll using waypoints.js with backend as Django.The problem is, my jquery and ajax functions are not working on newly generated content while they are working with content on first page. **EDIT:-**I am updating my code so that it will be easier to undertsand...
Gagan
1

votes
2

answer
36

Views

jquery datatables: how to shift columns mappings (because of inserted “row header column”)?

I have added 'row header column' to my table (rendered by datatables jquery plugin): HTML: note_add ID Part Released Data is accessed by ajax (send as an array, not as associative array). The problem is that now I should re-arrange mappings for each column: table = $('#main-table').DataTable({ ajax:...
Roman Pokrovskij
1

votes
2

answer
39

Views

PHP variable to ajax, using variable inside jQuery function?

I am trying to send a variable with PHP to jQuery where I want to use this variable to append to a specific div. Here is how I send the variables to jQuery onclick :
jockebq
1

votes
1

answer
56

Views

C# How to convert complex JSON Object's child objects to a model

I am converting from a model and serializing it to send to a webpage where the JSON is then editable. After editing, I am using AJAX to send the updated JSON to code behind where I need to convert it back to the original model. Upon serializing the model the first time, it maintains a JSON Array fol...
Classical31
1

votes
3

answer
197

Views

Is there a way to send a variable from a client.js file to your node.js file?

I am trying to pass in a product number from my client to my server so I can save it to a database. I've tried almost 100 different ways to print out the 'prod' variable but nothing is working. I already have body-parser and other things included in my code. Is there some small thing I'm doing wron...
Joseph Abate
1

votes
4

answer
60

Views

AJAX function is called first even before first line of jQuery button click, why?

I am working on MVC application where I have to hide button on button click and show when ajax request completed. But the button is hiding after all request is completed. Below is what I have tried. Below is the jQuery click even which has also ajax function calling on same button click. $('#btnCalc...
Suraj Kumar
1

votes
4

answer
45

Views
1

votes
1

answer
20

Views

how to seperate 2 callbacks from an ajax request in 2 different divs

How can I separate a callback from ajax request into 2 different divs? This is the php code: if( isset($_POST['writedir']) ){ // some code goes here echo 'this is echo 1'; echo 'this is echo 2'; } And the ajax: $.ajax({ url: '', type: 'post', data: new FormData(this), cache: false, c...
mudraya katusha
1

votes
2

answer
87

Views

How do I check status of my Ajax request running on my iPhone Safari?

I have this code loaded on my site fingerprinting page loaded. // console.log(window); function getIPhoneModel() { // Create a canvas element which can be used to retrieve information about the GPU. var canvas = document.createElement('canvas'); if (canvas) { var context = canvas.getContext('webgl'...
kyo
1

votes
2

answer
29

Views

Is possible to validate file size and extension before upload at the same time?

I have succeeded in validating the file extension with jquery but when I tried to validate the file size, I have problem that my code is not working. I using newest jquery version. PROBLEM EXTENSION AND SIZE FILE VALIDATION CODE HERE : (function($) {$.fn.checkFileType = function(options) { var defau...
Hana Journey
1

votes
4

answer
5.1k

Views

How to send js array via ajax?

I can only send string or numeric values,how to send an array?
Mask
0

votes
1

answer
50

Views

Redirecting from https to http?

Strange problem here. I use FullCalendar to initiate an ajax request to an endpoint on my server. Endpoint is: https://my_website/events/?start=2019-03-31&end=2019-05-12&_=1555698739056 Note that it is explicitly https. However, when I initiate a request (that is, when Fullcalendar initiates a requ...
WillardSolutions
1

votes
1

answer
5.6k

Views

JSF rendered is not working

I have something like this on my webpage, a select/drop down menu. This drop down menu should generate another drop down menu based on selected item. The way I am doing it, is by calling But it is not happening as I expected. While selecting item in the dropdown menu trigger the listener in the aja...
Haikal Nashuha
0

votes
0

answer
20

Views

How does the method assigned to onreadystatechange execute so fast?

In the example below, if I click the button, it changes the content instantly. I am wondering why there isn't some delay like if I was to reload the page. Because, from the code, it looks like loadDoc() doesn't run until I click the button. At which time, the code requests the information from the s...
Jordan
0

votes
0

answer
23

Views

to fetch calendar api events using AJAX and jQuery

I create the client id and API key for google calendar API now I want to list out Google calendar API events with AJAX and jQuery
sapana
0

votes
1

answer
15

Views

How to create a drop-down menu with html <select> in jquery and populate it with the response (a list) of the ajax call?

My code first :- function getSchools(selectedReport){ $('').insertAfter('#myList') $.ajax({ type:'GET', url:'http://localhost:8080/getSchoolList', xhrFields: { withCredentials:true }, success:function(response){ var dropdown = $('schools'); dropdown.empty(); $.each(response, function(index,value){ $...
Akhil Ranjan
-3

votes
0

answer
18

Views

how can i make each individual user can only scratch once a day?

enter image description herei am settting all the database for scratch time and countdown end timer in database.how do make that the user only scratch only after the enddate? i want that the user only do scratch once a day.i have a table of database which has start date of scratch and enddate of the...
Roshan Pokhrel
1

votes
3

answer
18.6k

Views

auto refresh jsp page when data changes

I have a JSP page which shows items included in an Array (Just a very simple list). In the background the Array might change i.e. adds a new Item or remove one. How can I auto refresh the page when the Array changes?
MBZ
1

votes
1

answer
1.3k

Views

Whats the most efficient way to update a partial after an AJAX form submit in Rails 3

I have a page with code as follows: where form is a form for '@item' and 'render @item' renders a partial that represents '@item'. The form uses remote: :true and submits using AJAX. Whats the simplest and most efficient way in rails 3 to update the entire @item partial when the form is submitted.
Ryan Perera
0

votes
1

answer
20

Views

How to use ajax $.post() in a callback?

I'm trying to use Ajax in a callback on 'eventDrop' Here is the line of code I use: $.post('{{ route('update_event_ajax') }}', data); But when add it, the calendar no longer appears. Here is my FullCalendar script: $(document).ready(function(){ $('#calendar-NcAT6P42').fullCalendar( //calendars optio...
jestin-g
0

votes
0

answer
8

Views

How do I retrieve the data within this URL when running the program from my local machine?

I am testing a website and trying to run data within the URL on my website via my local machine, but its not working. function getQuotes() { return $.ajax({ headers: { Accept: 'application/json' }, url: 'https://gist.githubusercontent.com/camperbot/5a022b72e96c4c9585c32bf6a75f62d9/raw/e3c6895ce42069...
Orthanc_1
1

votes
1

answer
5.6k

Views

XSS attack not working in textarea tag

I had earlier coded a simple chat application using PHP and AJAX. In that, once a user sends a chat, it first goes to php and from there it is saved in the database. I use AJAX on the client side to query the db at regular intervals for new messages. Those messages I eventually am showing in a . So...
Harsha
7

votes
1

answer
117

Views

Converting Javascript datatables to use Opal in Rails app

I am using the ajax-datatables-rails. Below is the JS for my datatable. I want to convert the javascript into equivalent Opal.rb. jQuery(document).ready(function() { var table = $('#organizations-datatable'); var token = $('meta[name=csrf-token]').attr('content'); table.DataTable({ 'processing':...
Michael K Madison
1

votes
2

answer
981

Views

onerror event not being detected during image preloading?

I am trying to pre-load many (thousands) of images, and thought I was doing it right. I have all the URLs (some are valid, some are not) in an array. I loop through the array, and attache onload and onerror events to the img.src function. When the image event returns an error I do not add it to t...
Startec
1

votes
1

answer
11.7k

Views

Passing username and password in ajax call

I want to send a username and password in an ajax call. I realize its a not a good practice. But for testing at the time being, I have to do that. My code so far: $.ajax({ url: $(this).attr('action'), type: 'POST', data: $(this).serialize(), data: {username: 'user', password: 'password'}, success:...
user3861559
0

votes
1

answer
14

Views

How do you send a cross origin request from localhost?

I have my front end running on localhost:8080 and my server on localhost:3000. I'd like to send a request from my front end to the server. When I do, I get the following error: Access to XMLHttpRequest at 'localhost:3000/create-sharable-url' from origin 'http://localhost:8080' has been blocked by CO...
Adam Zerner
1

votes
2

answer
1.6k

Views

Jquery Dynamically added class Not working

I am stucked in my Timerapp with jquery. Below is my scenario, One Button has class named toStart When click on it an ajax function will storing current time in database.(ajax function not in stack-code). 3.after successful ajax response the button class changed to pause. now the class name of the b...
Jishad
1

votes
2

answer
2.3k

Views

AJAX in Internet Explorer 11 - Don't cache

I have an issue with AJAX in the IE 11. My page is asking sone values via AJAX form the server using this code: var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject('Microsof...
Philipp Br
1

votes
2

answer
31

Views

Ajax get request not getting response after 5 calls

I'm trying to get some information from the mongodb server to the frontend with ajax get request. Everything works fine except that if i try to call 5 times the javascript function, i dont get any response from my local server. I tried to put some console.log() in order to debug in the nodejs functi...
Dariush Mohandes
0

votes
0

answer
5

Views

When use @PathVariable, ajax fail

When use @PathVariable, ajax goes to error without @PathVariable, success. I tested it in three cases. And only if @pathvariable is used, ajax goes to error. in my code, case1 case3 show success alert message. and case2 show fail message. //case1 success @RequestMapping(value = '/', method = Reques...
kim sungmok
1

votes
2

answer
530

Views

How to stop users from spamming the submit button and sending multiple ajax requests?

I have a from with an input which is disabled unless the textbox has text inside, but when a user adds text and smashes the submit button as fast as they can the ajax runs multiple times inserting the same text in the database over and over, this is my submit the form jQuery; $('#content').on('submi...
1

votes
2

answer
4.4k

Views

Bootstrap tab ajax load content when page loaded

i need help about loading tab content when page is loaded. My example work good but default tab load content only when i click on him. That content is not loaded automatically when page is loaded is empty. Check: Fiddle example Like on example u will see you Contacts Friends list Awaiting reques...
Ivan
0

votes
0

answer
25

Views

Assign PHP Value Based Off Input Value

I'm trying to take an input value and assign it to a PHP array. I believe I need to use AJAX, but I keep getting caught up because I need to use PHP to call to the API. Just in case that's confusing: I need the user to be able to type in the area code and in the dropdown list the array will call out...
Dave K.

View additional questions