When I click Show Contact link below, it should read the file from local disk and print its content. My example below prints [object XMLDocument] instead of actual content of the file.
Do I have to parse or convert it before printing?
Thanks
<script type="text/javascript">
function show_contact()
{
jQuery.get('file:///D:/contact.html', function(data)
{
document.getElementById('content').innerHTML = data;
});
}
</script>
<a href="#" title="" onclick="show_contact()">Show Contact</a>
<br />
<p id="content">hi</p>
Pass the dataType as the third parameter: