ajax4
By: a guest | Mar 19th, 2010 | Syntax:
None | Size: 1.17 KB | Hits: 42 | Expires: Never
i've got the following chunks.
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...
i'm not getting this yet!!
thoughts??
</style>
<script type="text/javascript" src="/includes/js/joomla.javascript.js"></script>
<script type="text/javascript" src="/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/media/system/js/switcher.js"></script>
<script type="text/javascript">
window.addEvent('domready', function(){ var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false}); });
</script>
.
.
.
<script language="javascript" type="text/javascript">
function foo()
{
var url1="administrator/index.php?";
var opt="option=com_colleges&test=1";
var url2="administrator/index.php?option=com_colleges&test=1";
var url3="http://www.google.com/search?q=joomla";
var test=new Ajax(url3, {
method: 'get',
update: 'foo'
}).request();
}
</script>
.
.
.
<a onclick="javascript: foo(); return false;" href="#">test ajax</a>
<div id="foo">
gggggg<br>
</div>