Share Pastebin
Guest
Public paste!

ajax4

By: a guest | Mar 19th, 2010 | Syntax: None | Size: 1.17 KB | Hits: 42 | Expires: Never
Copy text to clipboard
  1. i've got the following chunks.
  2.  
  3. the idea/goal is to do the ajax, get the results from the google/search and replace the div id="foo" with the results, so i can see the results in the updated page...
  4.  
  5. i'm not getting this yet!!
  6.  thoughts??
  7.  
  8.  
  9.  
  10.   </style>
  11.   <script type="text/javascript" src="/includes/js/joomla.javascript.js"></script>
  12.   <script type="text/javascript" src="/media/system/js/mootools.js"></script>
  13.   <script type="text/javascript" src="/media/system/js/switcher.js"></script>
  14.   <script type="text/javascript">
  15.                 window.addEvent('domready', function(){ var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false}); });
  16.   </script>
  17.  
  18. .
  19. .
  20. .
  21.                 <script language="javascript" type="text/javascript">
  22.                 function foo()
  23.                 {
  24.                         var url1="administrator/index.php?";
  25.                         var opt="option=com_colleges&test=1";
  26.                         var url2="administrator/index.php?option=com_colleges&test=1";
  27.                         var url3="http://www.google.com/search?q=joomla";
  28.                         var test=new Ajax(url3, {
  29.                                 method: 'get',
  30.                                 update: 'foo'
  31.                                 }).request();
  32.                 }
  33.                 </script>
  34. .
  35. .
  36. .
  37.         <a onclick="javascript: foo(); return false;" href="#">test ajax</a>
  38.         <div id="foo">
  39. gggggg<br>
  40.  
  41.         </div>