I have a Ajax post that returns the path to a PDF file i can not seem to get it to open the pdf in an Iframe of on the parent page.
Parent Page:
<div id = "mainpage" ></div>
<iframe class ="box2" id="myFrame2" width="600px" height="700px" scrolling="yes" align="right">
</iframe>
</div>
<script>
function onAjaxComplete(msg)
{
$("#mainpage").html(msg);
// alert(msg);
}
when I click on the ajax request it returns the correct value and the function will display the results in the div but I can not get it to open the pdf file in the iframe.
This is the PHP script for the call from Ajax:
<?php
$sitej = $_POST['site'];
$filenamej = $_POST['filename'];
$pagej = $_POST['page'];
$path = "scann/" . $sitej . "/" . $filenamej;
//var_dump($_POST);
$load = "$path/#page=$pagej ";
//$open = '<a href="' . $path . '/#page=' . $pagej . '">';
//$load = '<a target="myFrame2" href="'. $open . '">';
echo $load;
?>
Any suggestions? Thank you in advance!