Странно, но ничего не выводит. Ajax-а здесь пока, конечно нет, тест идёт на логически верной строке.
<html>
<head>
<script type="text/javascript">
function parseData(code)
{
var out=new String(code);
var re=<expand>/g;
out=out.replace(re,'<div class="expand">');
re=</expand>/g;
out=out.replace(re,'</div>');
re=<link=/g;
out=out.replace(re,'<a target="content" href=');
re=</link>/g;
out=out.replace(re,'</a>');
return out;
}
function heading_loaded()
{
var xml='<expand>Это-DIV</expand><link="javascipt.ru">А это-ссылка</link>';
alert(xml);
document.writeln(parseData(xml));
}
heading_loaded();
</script>
</head>
<body></body>
</html>
Вообще ничего не выводится...