i want to get the \'printed value\' of html pages.
i tried below query, but showGetResult() just return \'null value\'
but my apache server logs printed i access
You have the wrong dataType
per the documentation for jQuery.ajax:
"html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
So you want to use html
:
...
dataType: 'html',
...
function showGetResult( name )
{
var result = null;
jQuery.ajax({
url: 'http://localhost/index.php',
type: 'get',
dataType: 'html',
success:function(data)
{
alert(data);
result = data;
document.write(result);
}
});
}
showGetResult('test');