0

我有一个小程序可以加载大约 100 个左右的各种 PDF 文件我尝试使用这行代码 newWin.moveTo(0,0); 这就是发生错误的原因您将需要自己的 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>
4

0 回答 0