2015-02-07 4 views
0

У меня есть div в index.php (wordpress). Отправляйте номер на страницу.php с помощью jquery и возвращайте результат с помощью ajax в index.phpЗагрузка до Ajax Load

I Want Show Загрузка в Div (или текст или изображение) До тех пор, пока Ajax Loaded.

Вот мой код:

<script> 
myfunc = function() 
{   
    $("#target").slideUp(400); 
    $("#target").slideDown(400,"swing",function() 
     {       
      splittedURL=window.location.href.split("#"); 
      $.post('<?php bloginfo('template_directory'); ?>/page.php','state='+splittedURL[1],function(data,status) 
      { 
       $("#target").html(data); 
      })  
     } 
    );       
} 
</script> 
+0

Я хочу показать Загрузка сообщение в #target –

ответ

0
<script> 
myfunc = function() 
{ 
    $('#target').html("my html here"); 
    $("#target").slideUp(400); 
    $("#target").slideDown(400,"swing",function() 
     {       
      splittedURL=window.location.href.split("#"); 
      $.post('<?php bloginfo('template_directory'); ?>/page.php','state='+splittedURL[1],function(data,status) 
      { 
       $("#target").html(data); 
      })  
     } 
    );       
} 
</script>