AJAX Tools
AJAX language translation - translate text upon page load
echo '<div id="languagediv">Text in this box will get translated to Russian via AJAX upon page load.</div>';
$tools = get::helper('tools');
echo $tools->googleTranslateById('languagediv', 'ru');
AJAX language translation - translate text at any time after page load
echo $form->open();
echo $form->input(array('type' => 'textarea', 'id' => 'languagebox', 'value' => 'Translate anything typed in...'));
echo $form->close();
$tools = get::helper('tools');
echo $tools->googleTranslateById();
echo $html->link("javascript:vork.translateById('languagebox', 'it')", 'Translate to Italian');
AJAX data loading
AJAX data loading retrieves the contents from a page and loads it into any HTML container or form text element. To simplify usage, by default AJAX page requests only retrieve the view and skip rendering the layout around it.
Vork AJAX links degrade gracefully into ordinary links for browsers without AJAX support or when set to URLs that cannot be retrieved via AJAX (eg. JavaScript security limits AJAX requests to sites within your own domain) An AJAX link to another domain will behave like an ordinary link.
echo $html->link('/testimonials', 'Vork Testimonials', array('ajax' => 'ajaxbox'));
echo '<div id="ajaxbox"></div>';
AJAX data loading security
Implementation of AJAX security features are explained in the API