Я хочу получить «печатное значение» html-страниц.jquery ajax get return value
я пытался ниже запроса, но showGetResult() просто возвращает «нулевое значение»
но мои журналы сервера Apache печататься я доступен index.php, когда я пытаюсь этот код.
(index.php только для печати HelloWorld)
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"><\script>
<script type="text/javascript">
function showGetResult(name)
{
var result = null;
jQuery.ajax({
url: 'http://localhost/index.php',
type: 'get',
dataType: 'text/html',
success:function(data)
{
alert(data);
result = data;
}
});
return result;
}
document.write(showGetResult('test'));
</script>