You are here

function ajax_links_api_test in Ajaxify Drupal with JQuery Ajax 6

Same name and namespace in other branches
  1. 7 ajax_links_api.module \ajax_links_api_test()

Callback - ajax-links-api/test.

1 string reference to 'ajax_links_api_test'
ajax_links_api_menu in ./ajax_links_api.module
Implements hook_menu().

File

./ajax_links_api.module, line 203
Make any links or create new links to load content to particular DIV via jQuery Ajax.

Code

function ajax_links_api_test() {
  global $base_url;
  $link1 = '<a href="' . $base_url . '/user" class="test" rel=".test1">Load User Page</a>';
  $link2 = l_ajax('load this test page', 'ajax-links-api/test', '#content');
  $link3 = '<a href="' . $base_url . '/user" class="ajax-link" rel=".test2">Load User page</a>';
  $ouptut = '<h2>Method 1 : load Profile </h2>(link with class="test" and rel=".test1". You can ajaxify this link by adding this link
  class .test in module config page):<br />' . $link1 . '<div class="test1"></div>';
  $ouptut .= '<h2>Method 2 : load this test page </h2>(using l_ajax):<br />' . $link2 . '';
  $ouptut .= '<h2>Method 3 : Load profile </h2>(link with class="ajax-link" and rel=".test2"):<br />' . $link3 . '<div class="test2"></div>';
  return $ouptut;
}