Showing Loading Div For SJAX Requests
Aug 4, 2010
In my current project, I am using SJAX (i.e. synchronous AJAX) requests instead of pure AJAX requests in several places for better usability. One place is on the "unload" event, where the XMLHttpRequest must be synchronous in order for the program to work.
Anyway, when there is latency on the server, especially in peak traffic hours, it can be confusing to the user to see a frozen page for a couple of seconds while the SJAX request loads. As such, it would be beneficial to have a "loading" div reveal itself while the loading is taking place.
Here is the concept I currently have in place:
Code JavaScript:
document.getElementById("sjaxsubmitting").style.display = "block";
// Start Request
reqobj.open("POST", "myfile.php", false);
[Code]....
This works as expected in Firefox and Opera, although Opera is a little sluggish at first. However, Safari and Chrome continue to show the frozen screen without displaying the loading div, despite this code. I have not yet tested IE. Oddly enough, when I put a quick alert like "alert('hi there!');" before "Start Request" and after the display activating script, the loading div will appear in WebKit and will remain in sight for the duration of the request.
What could I change to make WebKit display the div in the same way Firefox does?
View 1 Replies
ADVERTISEMENT
Aug 28, 2010
This is a strange problem, because I have done this about 50 times, but this time it is not working. I want to show a loading gif when a user submits a form.
<form id="uploadForm" enctype="multipart/form-data" action="" method="POST">
<!-- DOM omitted. The form submits just fine.
<div id="loadgif"></div>
[code]....
View 4 Replies
View Related
Jun 6, 2007
I have a page with two frames "AlexTop" and "AlexMain" Alex Top contains a SELECT statement which essentially navigates the AlexMain frame to a new url.
What I'd like to do is - WHILE the AlexMain frame is loading the new page, a message should pop-up. (I want to use this for errors encountered in the AlexTop frame.)
The code I have right now which is cauing a BUNCH of problems is: Code:
View 1 Replies
View Related
Apr 9, 2009
I'm having trouble showing a loading image between loads but only in IE.
Code:
function PreLoad(){
cookie = new Image();
cookie.src = "loading.gif";
[Code]....
When a user clicks the button it references ShowImage() - PreLoad is used when the body loads. This works find in Mozilla browsers, but not IE. How can I get the loading graphic to show in IE?
(ShowImage() loads a dynamically generated image, and there is a brief pause before it is show -- that's why I need the loading graphic). I've tried Google but to no avail.
View 1 Replies
View Related
Jun 6, 2011
I am using anythingslider for slideshow and it is showing all images in <li> while page is loading all images and slideshow.
how to hide/disable showing images while loading slideshow.
View 1 Replies
View Related
Jan 17, 2009
I'm working on a chat box. Everything works fine with the chat contents in a separate frame except when it reloads. I'm using the <meta> reload and I don't like how obvious the refresh is. Could someone tell me how I can refresh the frame without having the status bar and tabs showing it loading.
View 1 Replies
View Related
Jul 23, 2005
how do I know when the browser is making a request to the server? I am
not having an onclick event for EVERY hyperlink, submit, etc. There
must be some javascript function that I can overwrite that will allow
me to do something when the browser requests something from the server.
My plan is whenever a browser is about to request something from the
server to create a time stamp and then compare this time to the time
when the page returns from the server. This will allow me to measure
performance.
View 3 Replies
View Related
Feb 14, 2006
Say I wrote an ajax script to send out HTTP requests via ajax. Any
cookies that I have associated with that site will be sent along with
this HTTP request. Is there a way to prevent this from happening? I
tried the following to no avail:
http.setRequestHeader('Cookie','');
View 13 Replies
View Related
Nov 2, 2006
I've noticed that IE have different security approach when loading a
page from an inner intranet or when loading a page from the web.
Is there a way in Javascript to know when your page is running by an
outsider and when by an insider? How the browser knows?
View 1 Replies
View Related
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
May 4, 2011
I can't see the requests of the forms by firebug to debug. Does anyone know if have any option or any way to do this?
View 3 Replies
View Related
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
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
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
Aug 24, 2007
I'd like to make an HTTP request using JavaScript but not with the XMLHttpRequest object. I'm attempting to make this request to a different domain to get information and the security of modern browsers won't allow this with the XMLHttpRequest object.
Is there another way to do this in JavaScript? Oh and I'm not taking advantage of the asynchronous nature that object either, so that's not a criteria for a potential solution.
View 1 Replies
View Related
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
Oct 20, 2011
I'm using jQuery Validate to validate my on-line things.it looks like a plugin issue, but my turn-arround was on ajax/param not on the plugin, so i put it on core.Today i faced a problem, that is: i use remote validation and i needed that all the form is submited to the validation. (this remote validation is like a bridge to the $.ajax)i have tried this, and of it is not the best deal, because it get the form on ready and don't change when the form change:
$('#nome').rules('add',
{
remote:
[code]....
View 4 Replies
View Related
Mar 3, 2010
Can I do the following without my program crashing? [code]...
I have created an application that does something similar to the code I just posted. However, my program crashes intermittently. Sometimes it will crash after calling jQuery.get() a few times (with several http requests still pending). Other times it will get through all of them just fine.
I want to know if Ajax can handle that many asynchronous requests without crashing? Can someone look at this to see if there is something I am missing?
View 10 Replies
View Related
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
Jun 18, 2010
I was wondering if the jquery out of the box allows for repeated ajax requests at a certain time interval to update elements on the page. I found a plug in that can do this:Just wanted to make sire i can ot inherently do it with jquery.
View 6 Replies
View Related
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
View Related
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
Feb 9, 2009
I'm using AIR to write an application that is mostly javascript (I am using jquery for quite a lot of it). The program has to be able to download multiple HTML pages (like a RSS feed reader might) and take a specific action when the download is complete, depending on which page has just downloaded. I'm using air.URLLoader with an eventlistener to notify when the page download is complete. The problem I have is that I want to run through a database table of around 20-30 URLs and dynamically create URLLoaders for each.I've spent hours searching Google and looking for ways to overload the event listener, add a property to the URLLoader object etc but all to no avail.
The code above will load whatever pages it is told to, but the problem I have is that it needs to take different actions depending on which page is loading. Each page in the database table has an ID field and I need to somehow identify the ID of the page within the notifyURLComplete function, hence the reason I'd like to pass the page ID into the event listener (apparently not possible) or add an additional property to the URLLoader object.Another possibility was a custom event handler, but I'm not sure how/where this would be done in my code.
View 2 Replies
View Related
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
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
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