Search the Community
Showing results for tags 'loading text'.
-
Hi, I am using jquery $.post() to get content from other URL. A reason behind that is it sends XMLHttpReqtest using which I can restrict users directly visiting the remote URL. Lets see an example of code which I am using <script> $(document).ready(function(){ $('#click').on('click', function(){ $.post("http://localhost/my_hiden_url.php/", function(data) { $('#content').html(data); }); }); }); </script> <button name='click' id='click'>Click</button> <p id='content'></p> So when I click the button called Click, it will call for URL http://localhost/my_hiden_url.php and put its returning content data as html into place where id='content' is mentioned. But many times when remote URL http://localhost/my_hiden_url.php takes lot of time because if fetches lot of data from database, till that time id='content' does not show anything and as soon as it receives some data from my_hidden_url.php, it pastes on <p> as it is. My question is in case of more time when http://localhost/my_hiden_url.php is working with database, how can I put an image of text as "Loading . . ." in place of id='content' ? So it should be like when I click Click button, it will show Loading image or text till it receives any data from my_hiden_url.php. How to do that ?
- 6 replies
-
- jquery post
- loading text
-
(and 1 more)
Tagged with: