0

my header This my header

this is my callfunction jquery/ajax This my ajaxcall1

this is the ajax with datepicker

this is the ajaxcall2

Update **** first part this is the firstpart second part this is the printscreen of loading jQuery process

my jQuery code

jQuery(function() {
    jQuery('<img src="images/ajax-loader.gif" id="loading" />').appendTo(".icompany_quo_for");

    jQuery( "#idatepicker" ).datepicker().find('img#loading').remove();;
});

is my jquery code correct? Because what im trying to do is show the loading .gif image when the jQuery was still on process loading the UI of the jQuery this is the datepicker;

Update ** because when the jQuery UI was loading the page was freeze and i cannot type or click anything...

Please let me know my if code was incorrect.

thank you

Butternut
  • 833
  • 1
  • 9
  • 21

1 Answers1

0

If #loading is child of #iddatepicker your code is right. I don't know the datepicker function of jq ui, but looking at the documentation i'd do it this way:

$(function() {
    var $loading = $('<img src="images/ajax-loader.gif" id="loading" />').appendTo('.icompany_quo_for');

    $('#idatepicker').datepicker({
        onClose: function() {
            $loading.remove();
        }
    });
});
Imperative
  • 3,138
  • 2
  • 25
  • 40
  • Imperative == Hi i try your codes, it didn't work, what it does is when the UI done process the loading image will appear so when i click the datepicker it will stop the image only let me upload some more images. – Butternut Feb 21 '13 at 09:00
  • if you see i already created an image loading so when i click the Date it will load the image, but when the box of the date show up the image loading was gone and the process of UI datepicker was running and it freeze my page. – Butternut Feb 21 '13 at 09:07