Show Ajax Loading Gif?

Apr 11, 2011

I'm using DataTables. And my all code is working fine. Now I want to put ajax loading gif. put ajax loader gif? here is my code.

<script type="text/javascript" charset="utf-8">
$(document).ready(function() {

View 4 Replies


Show Ajax Loading Gif Animation While The Page Is Loading?

I try to implement AJAX in my website. When the content of the div changepass is clicked then it should load changepass.template.php. Here is the code im using for that.

$(function() {
$(".changepass").click(function() {
return false;

how to show GIF Animation (loading.gif) while the page changepass.template.php is fully loaded.

View 4 Replies

Show Loading Png In The Short Delay Whilst Data Is Loading Using Jquery

I am trying to display a loading.png graphic in the very short time it takes to do my query e.t.c Everything below works perfectly currently. I just need to get the graphic loading in the td.available only when the productcode has been entered and is being checked.

$("#prodcodecheck").blur(function() {
var $this = $(this);
.closest('tr') // find the parent tr
.find('td.available') // find the imgsample in the row
.html( $(this).attr('id')) // update the contents
var available = $this.closest('tr').find('td.available')

View 3 Replies

Show An Loading GIF While Script Is Working?

I want to show an loading GIF while my PHP-script is working, small ex:



echo("<script>location.href = '';</script>");

If i run this example the page will load in 5 seconds, then show me the loading.gif in 0.3seconds and then send me to google. Is there any way to load all html to the browser then runt the PHP-script?

View 1 Replies

Show Page Loading Without Javascript?

I'm in the middle of re-building our website for users who don't have javascript enabled (surprisingly high percentage of our visitors).

What is the best way to show a user that something is loading without using javascript.

Background: Our login has to search for an email server before it logs someone in, it can sometimes take 5-10 seconds, sometimes up to twenty.

Current Thinking: I should reload the landing page with a new button that says loading and a loader icon and then redirect that to a page that actually does the logging in with header

Just realized I can't do this because the php reload has to be before anything is displayed on the page.

Perhaps there's onclick CSS I can use?

Could I create a hidden form and then submit the form w/ php once the operations are finished?

View 3 Replies

Ajax Loading Twice The Same Function?

I'm trying to create a subscription form which basically let's you select a game, then load's a bunch of subscription prices for that game. Up to this point, everything works perfectly. The problem is, when I try to input 3 radio buttons to select payement for 1 month/ 6 months/ 1 year, the function that I call with ajax onchange="" in the dropdown seems to load twice, and the content is not accessed.

The first time, it works perfectly, it echo's the information, and calculates everything. but the second time, it just gives me a php error.

I've figured out what happens, it call's the function once, with the requested subscription price id (alert(planId);), and it echo's perfectly as I wanted it. Then it just calls the function again, but the alert(planId); returns me undefined, and echo's a new row (which was meant to happen) with the error code, saying that the sql request failed because of line 78.

Which brings me back to my question, why does AJAX call the function twice?

var xhr = {
if (httpRequest.readyState==4) {
if (httpRequest.status==200) {
document.getElementById('plan_select').innerHTML = 'ready';
var price = httpRequest.responseText;
var six = 6*parseInt(price);

This is the part of the code, you'll see the alert(planId); in the updatePrice function.

Here's a link to the actual working thing: url

View 1 Replies

JQuery Ajax Not Loading

I have an input with the purpose of being a part of a search engine, on wich I use jQuery to pre-filter the search string removing forbidden characters as long as other things. Recently I had to change the url of the website and used PHP to print a variable that would indicate the url for ajax requests (as I was doing before, except that now normal and ajax requests have different url's), and I found a problem that I can't figure out what it is.

Basically the ajax request doesn't work (no actions and no request at all on Firebug). Tried every possible way (declaration inside the funcion, passed as argument, and so on) to tell my script the url I wanted, but it only works with the old url (even the ajax request never gets called). So I'd like you to check it and see if you find anything wrong.


edit: "acc" is a variable containing the url, wich prints exacly what I want when I call it inside search() function, the only thing that does nothing is the ajax request (isn't called at all). If I use the old url, it works, but the strange thing is that with the new url, at least the ajax call should be made. The code is all in the same server and domain, and nothing as changed, just the url of the requests.

View 2 Replies

JQuery And AJAX Loading

I am making a page that when you click on a "story" it loads the text and the media for that story, I have a seperate PHP script for the story text and the media (video or image) loading. both scripts work and actually it all works. My problem is that when you click the story it is supposed to load the text, and then slide the media down when it's loaded However, it slides down even when the text is still loading. [URL] is the site in question. click on the vimeo story on the left and see what I mean. The code for the AJAX that loads the story and media is:


Basically, I only want the media div to slide down once the video or image has finished loading.

View 4 Replies

Show How Many Requests Are Being Performed When Loading The Different Webpages?

In PHP/MySQL, is there a way to show how many requests are being performed when loading the different webpages? I would like to know how often PHP accesses the database and if possible how long it takes.

View 1 Replies

Ajax - Best Practice For Pre-loading Images?

I have put together a script which is very much like the flickr photostream feature. Two thumbnails next to each other, and when you click the next or prev links the next (or previous) two images slide in. Cool! Currently when the page loads it loads the two images. The first time nxt / prv is used then the next two images or previous two are loaded via ajax, with the id of the first image being passed in the url and the HTML for the two new images returned and displayed via ajax.simple enough, but it got me to thinking, on a slow connection, or heavy server load then the two images, although relatively small thumbnails could still take a while to load, and the nice things with sliding panes is the fact that the hidden data slides in quickly and smoothly preferbly without a loading delay.So I was wondering from a performance and good practice point of view which option is best, this is what I can think of for now,

1, call each set of images via JSON (its supposed to be fast?)

2,load all the possible images into a json file and pull in the details that way - although browser will still have to load image. Plus sometimes there might be 4 images, other times there could be upto 1000!

3, Load 10 images via php into a Json or other file, and load all 10 images into the browser hiding the 8 which are not on show, and always showing the middle two. Problem here is that each time someone clicks, the file has to reload the first and last images, which still takes up time, although i suppose the middle images will have all been cached via the browser by now though. But still there is a loading time.

4, Is it possible to have a json image with all the image details (regardless of numbers) and use no 3 above to load 10 of those images, is it possible to use ajax to only read 10 lines and keep a pointer of the last one it read, so the json file can be loaded fast, short refresh and images either side are cached via the browser?

View 5 Replies

Loading Progress In Ajax Or JavaScript?

how can I display the loading progress with completed % on my client side while the system is still getting data in the server side. For example, when I press 'ok' button in the client side, it will call to server side to collect data from the database, the whole process may take 2 to 3 mins. How can I display the loading progress on the client side (about how many % of the loding have been done)?

View 6 Replies

Loading Data In A TextBox Through Ajax?

In my form I dynamically created a textbox, therefore an array of textbox. If a user select an option into a combo box, data will be retrieved in the database an will be displayed on the dynamically created textboxes. My problem is, how am I be able to display the data into these array of textbox using AJAX.

View 5 Replies

Adding Ajax Loading Gif To Script?

I have the below script that updates a series of drop down boxes, populated depending on the users previous answer. Data comes from SQL tables. I was wondering how I could add an Ajax loading gif to each drop down while the data is loading.

<script language="javascript">
var xmlhttp
function selectmanu()


View 2 Replies

Javascript AJAX Function Not Loading?

I had a realtivley simple ajax application, which I have broken up to be more modular. The code is at the link below, and what I have mainly done is add the GetRecordSet function and allowed fetchcompelte to take a variable for which layer to put data in. It should work fine in thery. When I put alert()s in, the code seems to execute, except for inside either of the if clauses in fetchcomplete. [URL] This is the code for get_records.php, which again seems like it should be fine [URL] and this is the original index php file [URL]

View 2 Replies

Ajax Script Not Loading Anything And No Requests Being Sent?

This script is supposed to run a jQuery Ajax script every second, it is supposed to fetch all newer posts then put them on top of the original ones. But at the moment nothing is happening, it loads the initial posts but nothing else. Firebug console is reporting no errors, or no Ajax requests being sent at all. Can you see anything wrong with this script at all that could cause this?

Source code -
index.php(i left out css):


View 2 Replies

Loading Cities Combo Using AJAX And It

I am trying to load city combo using AJAX and PHP.....but its showing nothing... This is AJAX

HTML Code:
// JavaScript Document
// JavaScript Document
var xmlHttp
// Start of loading Constituency //
function loadcity(state_search)
var value=document.getElementById('inpstate').value;
//var lang=document.getElementById("language").value;

View 1 Replies

Problem Loading Page With Ajax

I'm trying to load a page with ajax but it's javascript file not being loaded with
I want solution for this problem.

View 2 Replies

JQuery And Ajax Loading Only One Item From The Database

look at this code:

$('ul#navigation li ul li>a').click(function(){
var active = $(this).text();
$('#artcontent p').empty();
type: 'POST',


This is the function that is on the server.

I have a ul li a that are children of parent ul navigation and li. What I am trying to do is to load an article page. This works but it reads the database and loads all the articles in my database instead of the one identified by active. I would like to know what I am doing wrong or is there a better way to go about this?

OK, the 'homepage/readarticle' is the 'controller/method' in my CodeIgniter controller which loads the view that renders the article.

As for the serialize line, I actually put in active without the serialize and could catch the text of the link with Firebug using the usual console.log(). Like I said, it reads the articles all right, but it reads all the articles from my database instead of fetching the one whose title is equal to the name in the active variable (that would be the text of the link so, for example, <a href="#">see this</a>. See this is the text.)

OK, let me add the code that handles this also from the model which is the last piece in:

function displayby_name($name) { $this->db->select("articletitle,articlebody,articleauthor");
$this->db->from('articles'); $this->db->where('articletitle',$name);
$Q = $this->db->get(); if($Q->num_rows() > 0){ $text = $Q->result_array(); }
echo $this->db->last_query();
return $text; }

View 3 Replies

Ajax Loading In Drupal Using Ctools Breaks?

I'm working on a custom module using CTools ajax and form. I tried to combine this example with the one from here. It goes like this: a user chooses from one of the radio buttons, on submit the map of US+Canada is going to load with links to another page with the maps. Depending on their choice, the map of the selected country is loaded. The last step is where I get ajax loading errors. No js works fine.

My code looks like this:

function eval_interface_menu() {
$items = array();
$items['eval'] = array(
'title' => 'Find your Sales Engineer',


View 1 Replies

Show Loading Animation Before Printing Buffer Content From Ob_start()?

I have a script that runs for quite a while and i am using ob_start() to buffer the output and print the result after the script finishes executing...I need to show some loading animation while the script executes and replace it with the output when the script finishes executing...I know that it can be done quite beautifully with javascript and jquery.... I was just wondering whether it can be done using php alone...? Is there any library that allows php to do this...?

View 4 Replies

Open A Webpage In The Background - Show The Page Has Finished Loading?

How to run a php script in the background on the server when a user opens a webpage?

Important: The user does not note when the script finishes and DOES NOT NEED THE OUTPUT.

So the user nudges the script indirectly by visiting the webpage and that is all about it.

View 2 Replies

Html - Loading Includes In An AJAX Called File?

I need help getting an ajax function to work properly. I have a page that does a simulated search of a person's zip code. It shows a Google map of their location and an ajax loader.gif. After a 3000 MS timeout, the ajax function is called to load more content in a <div id="content"></div>The problem I am having is that the content that is loaded in the div doesn't seems to be getting any of the CSS styles I need and a few php includes. If I load the page that is called via the ajax function directly in the browser, everything displays fine. But when loaded in the ajax, I am missing the CSS and the PHP includes. Need someone ASAP to help me figure this out! Please respond.Here's my code:

include($_SERVER['DOCUMENT_ROOT'] .'/inc/tokens.php');


View 1 Replies

Ajax Loading Doesn't Work When Form Validates?

Im using a form to upload files to my server and I want to load a progress bar when the form validates. This is code I have with jQuery:

var valid_form = validateForm();
if (valid_form){
return valid_form;

The problem is I get this message after submit:

GET [URL] undefined (undefined)

But the weird thing is that I tried inverting the condition of the IF and when the form doesnt validate, the ajax loading actually happens. What is going on??

View 1 Replies

Jquery UI Portlets - Loading And Editing Portlet Using Ajax?

I am trying to create an igoogle interface using PHP, MySQL and JQuery UI and I stumbled on jquery UI's portlets over here:[URL]To specify a URL and load ajax content?To have an edit button, that will edit the portlet in place. The editing content can come through aURL using ajax.or additional details,look at "Edit" functionality here:[URL]

View 1 Replies

JQuery/AJAX: Loading External DIVs Using Dynamic Content

I need to create a page that will load divs from an external page using Jquery and AJAX.

I have come across a few good tutorials, but they are all based on static content, my links and content are generated by PHP.

The main tutorial I am basing my code on is from: [URL]

The exact function i need is as follows:

Main page contains a permanent div listing some links containing a parameter. Upon click, link passes parameter to external page. External page filters recordset against parameter and populates div with results. The new div contains a new set of links with new parameters. The external div is loaded underneath the main pages first div.Process can then be repeated creating a chain of divs under each other. The last div in the chain will then direct to a new page collating all the previously used querystrings.

I can handle all of the PHP work with populating the divs on the main and external pages. It's the JQuery and AJAX part i'm struggling with.

var sections = $('a[id^=link_]'); // Link that passes parameter to external page
var content = $('div[id^=content_]'); // Where external div is loaded to{


The problem I am having is getting JQuery to pass the dynamically generated parameters to the external page and then retrieve the new div. I can currently only do this with static links (As above).

View 5 Replies

Jquery - Loading Data From Form Into Ajax Driven Page Using Change

I have a form that I need to check/validate two dates once they change their values. Once they change I had an Ajax call that loaded a page "checkdates.php" and passed in two bits of data. The Date that changed and a project name to "checkdates.php" using GET and adding the data to the URL string.

This Ajax call loaded the page in a div with the ID "status" and php page displayed what the outcome of the date check was. The Old code used prototype to pull in the data as a function and I used the onChange event on the form elements:


View 3 Replies

Copyrights 2005-15, All rights reserved