这是我的js部分
function openFiles(fileSlNo){
document.forms[0].method = "POST";
document.forms[0].target = "test";
document.forms[0].action = "folderNavigation.do?pageMode=DOWNLOAD_FILE&fileSlno="
+ fileSlNo;
document.forms[0].submit();
}
<div id="content">
<iframe id="displayframe" name="test"></iframe>
</div>
请告诉我怎么做?提前致谢
答案 0 :(得分:0)
根据描述&amp;评论,您正试图将一些参数发布到服务器&amp;作为回应,您需要提供PDF的路径。
以下是代码:
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
<div id="showDialog" title="Your Dialog Title Here" style="display: none;">
</div>
<form name="frmDemo" action="" method="post">
<input type="text" id="fileSlNo" name="fileSlNo" />
<input type="submit" value="Show Dialog" />
</form>
<script type="text/javascript">
$(function(){
$('form').submit(function(event){
event.preventDefault();
var fileSlNo = $('#`').val();
var data = { pageMode: 'DOWNLOAD_FILE', fileSlno: fileSlNo };
$.ajax({
type: POST,
url:, 'folderNavigation.do',
data: data,
success: function(responseData){
// supposing responseData is the url of PDF
$('#showDialog').dialog('destroy');
$('#showDialog').html('<iframe src="'+responseData+'"></iframe>').dialog({
height:400,
modal: true
});
}
});
});
});
</script>