在newWin中加载PDF文件

时间:2013-06-25 21:43:59

标签: jquery

我有一个小程序来加载大约100个左右的各种PDF文件我不确定这是管理此任务的最佳方法但是它有一个例外Permission denied ERROR当我在调试模式下运行此代码程序有当我尝试使用这行代码newWin.moveTo(0,0)时的不稳定行为;这就是ERROR发生的时候 您将需要自己的PDF文件

我很感激错误的帮助,如果有人有更好的设计理念,请随时说出来

感谢

<!doctype html>
<html lang = "en">
<head>
<title>PDF Select</title>
<script src="jquery-1.9.1.js"></script><!-- this is the path within the folder-->

<script>
$(document).ready(function(){

//$("<span>Download a PDF of </span>").insertBefore("a[href$=.pdf]");
$("#findWhat").change(function(){
pageone();
});

});

function pageone(){

var winProp = "width = 1015, height = 760";
var X = $("#findWhat").val();//What number selected
//alert("my value " + X);
if (X == 1){
var newWin = open(href = "first.pdf","aWin",winProp);
newWin.moveTo(0,0);
$("#findWhat").val(0);
}
if (X == 2){
var newWin = open(href = "second.pdf","aWin",winProp);
newWin.moveTo(0,0);
$("#findWhat").val(0);
}
if (X == 3){
var newWin = open(href = "third.pdf","aWin",winProp);
newWin.moveTo(0,0);
$("#findWhat").val(0);
}
}

</script>
</head>

<body alink="blue" link="black" vlink="red">


<p><a href = "first.pdf" target = "_blank">TPN Order Form</a></p>
<p><a href = "second.pdf" target = "_blank">Integrilin Dosing Protocol</a></p>
<p><a href = "third.pdf" target = "_blank">Enoxaparin Dosing</a></p>

<p>
<select id = "findWhat">
<option value = "0"></option>
<option value = "1">TPN</option>
<option value = "2">Integrilin Dosing Protocol</option>
<option value = "3">Enoxaparin Dosing</option>
</select>
</p>

</body>
</html>

0 个答案:

没有答案