Use ajax correctly in joomla.
Posted: Mon Sep 29, 2008 5:24 pm
When you call a request via ajax, returned data will have more html code than needed data.
when I try to call ajax via url index2.php?option=com_hello data return still have doctype and more html tag
while I only want this data : <!-- ajax data here -->
Currently I use exit to stop execute script, But It is not good solution for this problem.
Any body can tell me how to disable render layout and only return ajax data?
when I try to call ajax via url index2.php?option=com_hello data return still have doctype and more html tag
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="keywords" content="Ketnoivn, Ketnoivn" />
<meta name="description" content="Joomla! - the dynamic portal engine and content management system" />
<meta name="generator" content="Joomla! 1.5 - Open Source Content Management" />
<title>Ketnoivn</title>
<link href="/joomla/templates/ja_purity/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" href="/joomla/templates/ja_purity/css/template.css" type="text/css" />
</head>
<body class="contentpane">
<!-- ajax data here -->
</body>
</html>
Currently I use exit to stop execute script, But It is not good solution for this problem.
Any body can tell me how to disable render layout and only return ajax data?