JQuery :: Launch Two Ajax Requests At Same Time?

Feb 12, 2010

I'm trying to launch two ajax requests at same time. I'm expecting result from the first later than the second. The problem is, it won't return me any result from the second request untill first one is returned.

Check it out :

$.post("sendMail.php");
getSendInfo();
setTimeout(getSendInfo,5000);

[code]....

I'm getting response from the $.getJSON function only when the $.post is over. Is this a bug or a mistake from me ? My aim is to launch a long request and fire multiple other requests to check how is doing the first one.

View 3 Replies


ADVERTISEMENT

Ajax :: Multiple Requests At Same Time Not Working

Apr 18, 2011

I'm encountering an AJAX problem when I try to execute multiple AJAX requests at the same time. What I want to do is delete a message and display the status (succes or failure) of that in div1, and refresh the messages on the page in div2. This needs (for as far as my knowledge reaches) two AJAX actions from which I both need the responseText.

The problem:
What happens when I execute my script is that the second action (refresh a part of the page) happens before the deletion is executed. The result of this is that when the deletion has been executed, the page is already updated, and the deleted message is still there.

The script
What I now have is:
function doAjax(url, element_id, img_url){
var ajaxObject = createAjaxObject();
ajaxObject.open('GET', url, true);
ajaxObject.onreadystatechange = function(){
if(ajaxObject.readyState==4 && ajaxObject.status==200){
document.getElementById(element_id).innerHTML = ajaxObject.responseText;
delete ajaxObject; .....

View 3 Replies View Related

JQuery :: Automatically Launch Function Before Going In $.ajax

Oct 19, 2010

what I'm trying to do is to automatically launch a function before going in the $.ajax ({success}); method. I've this:[code]My problem is that I first see "success" and then "ajaxSuccess" or would have the opposite.dataFilter function doesn't help me because I can't detect if query is successfull or not and not have the XMLHttpRequest.

View 1 Replies View Related

IE6 Requests CSS Background Image Every Time!

May 7, 2007

I found a bug in IE6, though it is known already. If I have a CSS
background property set to some image, such as
background:url(myimg.gif);, and I apply this property to some html
element, say DIV, and refresh DIV every 10 seconds, background image
is reguested every 10 seconds for IE6, too.

The fix which I found did not fix the problem:
try {
document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
Code:

View 4 Replies View Related

JQuery :: IE Caching AJAX Requests?

May 14, 2009

It looks like IE is caching the response for some AJAX requests here. The app I'm working on is a catalog of sorts. Clicking the link for a category loads a set of "items". Those, in turn, may be deleted from the admin view. The delete works fine (I checked the DB) but, when loading the same set of category items, I'm seeing the list unchanged. That is, the thing that was deleted is still there. Sorry for the crap explanation but I'm not really sure of a better way of putting it. Bottom line is, has anyone seen this sort of behavior with IE before? Can it cache the result of an AJAX request like that? And, if so, how can I guard against that? Can I set cache-control headers for an AJAX request?

View 2 Replies View Related

JQuery :: Double Submitted Ajax Requests

Apr 29, 2009

Very intermittently, I am finding ajax requests submitted with jquery are being submitted twice, once with parameters, and once without parameters. The code looks something like this:

[Code]...

View 2 Replies View Related

JQuery :: 1.4.2 - AJAX GET Requests Do Not Follow Response Code 302?

Oct 25, 2010

I'm having problems performing a simple load(...) request to bring in HTML content from a partner Oracle system within the same domain. Our portal has a built-in SO connection will handles security for me transparently. However during the process it initiates a 302 temporarily moved response which seems to trip up an AJAX request, but doesn't trip up Firefox when accessed through the address bar. If I use the same URL in an IFRAME it's totally fine.

After tons of googling, searching the forums, and the bug tracker database I cannot find anyone who has experienced this problem. Before I open a bug ticket I'd like community feedback to help me see if I am doing anything wrong.

My AJAX call looks like this in Javascript:

View 7 Replies View Related

JQuery :: Control Large Number Of Ajax Requests?

Mar 26, 2010

I have a element when click, it will trigger some other elements to be selected. and those elements will trigger elements in next level.

It is a three levels hierarchy so to speak. but each element will send an ajax request when selected. Those requests will become out of control especially when I repeatedly click the root element.

Can I queue those XHR request in a queue and send them one by one? or maybe add a delay before send so that they can collect their information into one batch request and send one request after that.

View 2 Replies View Related

JQuery :: IE Does Not Properly Handle Multiple Ajax Requests

May 11, 2011

I have a page that relies on AJAX for content manipulation. Once a person selects a radio button, a request is made through $.getJSON() to get the replacement content. This works in all browsers. Once the new content is loaded, there are 3 more calls to $.getJSON() to change more content (on other tabs in jQuery UI). This works in all browsers except for IE.

I understand this is a Microsoft problem, and not a jQuery problem, but I am wondering if there is a way to manipulate the jQuery calls to get them to work in IE. I did try replacing $.getJSON with $.ajax, and even set async to false. None of those three methods worked in IE. I noticed the problem when my loading div was still displayed in IE. Using Firebug Lite, I saw that only one request was made, rather than four.

View 3 Replies View Related

JQuery :: Uniquely Identifying Ajax Requests / Responses?

Jul 23, 2010

I am developing a fairly complicated application with a lot of JavaScript and making use of JQuery. The application repeatedly makes simultaneous GET requests.

I am looking for a way of assigning a unique token to each request when it is made, so that I can store information about that request and cache the request / response combo, when using $.get() (or potentially $.ajax() if required for the extra functionality).

So far I have not had any joy and after a while googling this am none the wiser. I have used similar functionality in Flex 3 with the AsyncToken object which can maintain data between HTTP request / response.

[Code]...

View 1 Replies View Related

JQuery :: Display An Activity Loader Automatically With All Ajax Requests?

Jan 29, 2011

I'm working on a php/jQuery application, I want to display a loading image automatically every ajax request, without writing code for every ajax request. Is there anyway to do this.

View 1 Replies View Related

JQuery :: Global Object Created In All IE Browsers When Aborting AJAX Requests

Oct 3, 2011

When a pending ajax request is aborted in IE browsers there is a new global object called "jQuery" + timestamp, for example "jQuery16405272192696596443".

This happens in every IE from 6 to 9 but not in Chrome, Safari, FireFox in their current stable versions. I am a bit lost and found nothing similar. I created a little test page to determine whether it started due to some own code or just in this little piece.

Example HTML:
<!DOCTYPE html>
<html>
<head>

[Code].....

View 1 Replies View Related

JQuery :: Ajax Form Submit - Multiple Post/get Requests Caused When Validation Fails?

May 6, 2010

I have a problem where if a form submission (set up to submit via AJAX) fails validation, the next time the form is submitted, it doubles the number of post requests - which is definitely not what I want to happen. I'm using the jQuery ValidationEngine plugin to submit forms and bind validation messages to my fields. This is my code below. I think my problem is that I need to unbind from the validationEngine plugin when the form fails, but I can't figure out how to do this.

[Code]...

View 1 Replies View Related

Ajax :: Separate The Different Requests On The Page?

Jan 12, 2009

I have this function among many that houses forms. I'm also using an ajax page that is supposed to deal with form's entries and insert everything into my DB and I don't know how to separate the different requests on the ajax page so that it can do what the correct request is.

[Code]...

View 1 Replies View Related

Ajax :: Handling Multiple Requests?

May 15, 2011

This might seem like a silly question..First issue. If i have a response and i'd like to update both text div and a status div how would i go about doing this. I've seen that jQuery has a few options such as OnSuccess etc?

Say that i post a comment and obviously you'd want to update some kinda statusbar on your website with the info that the message was posted successfully with ajax. (otherwise it might slip by the user unnoticed since ajax is kinda discrete)

Would it be a good way to for instance check the responseText if it contains anything and if it does you simply write a successmessage by grabbing a div from JS and if the responseText contains a custom error code lets say 1 you'll update the statusbar with a deny message?

Second thing. I've currently created an Ajax search on my site which activates whenever the user press or unleash the button. The issue is that if the user types fast enough it comes stuck showing the Loading.gif constantly. Could this be due so many requests opening and that i have a sleep on the server-side and if so how would you do it instead? I am using a serversleep of 1 second to have the Ajax pic appear consistently.

[Code]...

View 4 Replies View Related

Ajax :: Sends Multiple Requests

Aug 19, 2011

I have a jsp page using ajax that has a button with an action. The action sends multiple ajax requests. The response from these requests is to be used to update a progress indicator to show the servers current progress. I can see from the debug that I am getting the 1st response. I think it is the way how I have implemented the further requests. I think this is down to my javascript knowledge, which isnt very much. Also I assume using multiple requests in this way is the correct thing to do? I have spent ages trawling the internet trying to get a solution.

View 4 Replies View Related

Ajax :: Sending Multiple Requests To Server

Mar 18, 2009

I need to send 15 requests to my server and get results, these results are queries to other sites. I then update my page with the results. I need to know if I am taking the correct approach, as things are working a bit slow, and i.e., seems the be as slow as a snail.

Here is my function for the first request
Code:
function one(){
var xmlHttpa=null;
try{
xmlHttpa=new XMLHttpRequest();
} catch (e){
try {
xmlHttpa=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e){
try {
xmlHttpa=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert("Your browser does not support AJAX!");
return false;
}}}

xmlHttpa.onreadystatechange=function(){
if(xmlHttpa.readyState==4){
document.getElementById('resulta').innerHTML = xmlHttpa.responseText;
var el = document.getElementById('showMessagea');
el.parentNode.removeChild(el);
applystyle();
}}
xmlHttpa.open("GET","one.php",true);
xmlHttpa.send(null);
}

I then call this function and others from my page, one(); two(); etc. Am I correct in my approach?

View 1 Replies View Related

AJAX :: Encrypt Requests And Responses From The Server?

Jul 12, 2011

I need to encrypt my AJAX requests and responses from the server. As the message format I use simple JSON.Can you advise any libraries about it?

View 7 Replies View Related

JQuery :: Application With PHP - Ajax Doesn't Work Time To Time ?

Apr 21, 2011

I'm writing an application with PHP that let me have statitics about visited pages for my web site. to save informations needed i use an ajax query with the unload event. The problem that i have is titme to time the script uses with that ajax query doesn't work especially when i stay long time in a page.

This is my code?

Why it works most of time but sometime doesn t work? is there any specifications to take for the unload event ?

View 11 Replies View Related

JQuery :: Ajax Loading In The Same DIV 1 Time Yes And 1 Not?

Jan 6, 2010

You need the link to be out side the div you are loading your content into. As the line "$('#wrapper_of_subpages').load(this.href + " #wrapper_of_subpages");" in your code don't copy the event with the link you need some other way to keep your link event.

View 4 Replies View Related

JQuery :: Ajax Not Working A Second Time

Oct 5, 2009

I have some simple [code]...

When I click on A1 or A2, the text from the associated files is loaded into #Info, so that works fine. However, when I click on the A1 or A2 class within #Info, nothing happens.

View 1 Replies View Related

JQuery :: AJAX Only Loading One Time In IE?

Oct 19, 2011

I am working on a page which uses a JQuery AJAX to call another php page that displays a list of random items and reloads every 2 seconds. The below code works in Chrome and FF but only once in IE,

[Code]...

View 4 Replies View Related

JQuery :: Ajax Response Time Inconsistent?

Feb 27, 2011

What I'm doing is creating a div element dynamically when the user clicks on a point in the page. Once created I create a record in my database table the corresponds to this div element and save information such as the width,height, x coordinate, and y coordinate of the element. This is done via AJAX accessing my web service. The weird thing is, I get really fast responses 80% of the time but 20% of the time, its taking a lot longer. For example, I would get a response after 50-100ms and at times I would get it in 2 seconds What do you think is the source of this problem?

View 2 Replies View Related

JQuery :: Multi Request Ajax At The Same Time

Aug 15, 2010

i has a page that has three tabs . when user access page three tab get content by ajax. i want to get content three tabs at the same time. what should i do? And i try to addsortable for my tabs but i don't work as i want. i want when i move tab everything in tab move together. this is my prolem [URL] $(".tab").sortable({connectWith: '.tab'}); i want my tab sortable like [URL]

View 5 Replies View Related

JQuery :: Error Callback Fires Every Time In Ajax

Oct 19, 2011

What I noticed is that my error callback is fired every time.
MyService.asmx:
[WebMethod]
public FileInfo[] GetFileInfo(int Id){
Proxies.ServiceRef.ServiceClient c = new Proxies.ServiceRef.ServiceClient();
return c.GetFileInfo(Id).ToArray();
}

The Jquery code where I am getting error:
$.ajax({
url: url,
data: jsonData,
type: "POST",
contentType: _I.contentType,
timeout: _I.timeout,
dataType: "serviceproxy", // custom type to avoid double parse
dataFilter: function (jsonString, type) { .....

When I debug using firebug the response is as follows.
{"d":[{"__type":"Proxies.AFARServiceRef.AssignmentInfo","ExtensionData":
{},"AssignDate":"/Date(1317748587667)
/","AssignFileName":null,"ClaimId":"PA026195","ClaimantName":"Rachel
Weiss","FirstContactDate":"/Date(1302678000000)/","FirstContactTime":{"Ticks":433800000000,"Days":0,"Hours":12,
"Milliseconds":0,"Minutes":3,"Seconds":0,
"TotalDays":0.50208333333333333,
"TotalHours":12.049999999999999,
"TotalMilliseconds":43380000,
"TotalMinutes":723,"TotalSeconds":43380},"Id":5257,
"InspectionDate":"/Date(1302246000000)/","StatusId":1,"SubmittedCount":5,
"UploadedCount":9}]}

View 1 Replies View Related

JQuery :: Ajax Call To Work - Display The Current Time

Jun 13, 2011

I'm using jquery with a simple ajax call to display the current time, but I'm getting undefined for the time instead of the actual time and I'm not sure why.

This is my code:

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved