How can I render an element after pageload?
Okei. here goes.
I have an element (test_element.ctp), that perform an API call.
I use a regular: echo $this->element('test_element', array("limit" => 2));
to load it:
<div id="TheElement">
<?php echo $this->element('test_element', array("limit" => 2)); ?>
</div>
So far so good. The element load API call and display data as it should..
Now to my question, HOW can I make a jquery/ajax approach, to display loading icon until the API call/rendering inside the element is done, and then update the div with the finished data?
So that my website will load everything else on the site and display the api data when the element is finished loading in the background??
Now the rest of my website content will need to wait for the element to finish talking to the API before displaying the page..
Anyone know of a good approach to this?
Thanks!
-Tom
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home