我有一个系统可以生成一个可以在线填写然后发送到打印机的页面。
系统使用AJAX从现有页面获取数据并将数据发送到java servlet。 servlet构建html并将其发送回单独窗口中显示的位置。
但是,单独窗口中生成的html不会触发任何事件(如点击),直到它刷新为止。如果我点击"打印"页面上的按钮,在我刷新之前没有任何反应,此时我的打印对话框出现了。
AJAX电话:
function printForm(warrants) {
$.ajax({
type: "GET",
dataType: "html",
url: "AjaxServlet",
data: {formType: 'printForm', warrants: warrants, headerValues: getHeaderValues()
},
success: function (data) {
var win = window.open();
win.document.write(data);
}
})
}
生成的html页面:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="author" content="radelman"/>
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/fau.js"></script>
<style type="text/css">
h1 { font-family: sans-serif; font-weight: bold; font-size: 16pt; }
.s1 { font-family: sans-serif; font-weight: bold; font-size: 8pt; }
.s2 { font-family: sans-serif; font-weight: bold; font-size: 9pt; }
.s3 { font-family: serif; font-weight: normal; font-size: 10pt; }
.s3a { font-family: serif; font-weight: bolder; font-size: 10pt; }
.s4 { font-family: sans-serif; font-weight: normal; font-size: 9pt; }
.s5 { font-family: serif; font-weight: normal; font-size: 9pt; }
h2 { font-family: sans-serif; font-weight: bold; font-size: 14pt; }
.s6 { font-weight: normal; font-size: 14pt; }
.s7 { font-family: serif; font-weight: normal; font-size: 14pt; }
.s8 { font-family: sans-serif; font-weight: normal; font-size: 6pt; }
p { font-family: sans-serif; font-weight: normal; font-size: 12pt; }
.s9 { font-family: serif; font-weight: normal; font-size: 12pt; }
td { text-align: center;padding-bottom: 5px;padding-top: 5px;}
input.skinny{width: 40px;};
input.superskinny{width: 35px;}
input.seventyfive{width: 75px;}
input.sixty{width: 60px;}
input.sixtyfive{width: 65px;}
input.seventy{width: 70px;}
input[type="text"], textarea{
background-color: lightblue;
text-transform: uppercase;
}
input.resize{width: 94%;margin-top: -3px;}
@media screen {
div.divFooter {
display: none;
}
div.printButton{
display: inline;
}
}
@media print {
div.divFooter {
position: fixed;
bottom: 0;
}
div.printButton{
display: none;
}
input[type="text"], textarea{
font-family: sans-serif; font-weight: bold; font-size: 7pt;
}
}
</style>
<script type="text/javascript">
function showMessage(){
alert("running");
}
</script>
</head>
<body onload="showMessage()">
<div class="divFooter" style="font-size: x-small;width: 100%;text-align: right;">
<span style="float: left;">Arrest/Booking for AGUILAR, JESSE</span>
<span style="float: right;">BCSO Form #351-045 (Rev. 07/06/11)</span>
</div>
<div style="width: 100%;text-align: center;">
<h1>SHERIFFS OFFICE ARREST & BOOKING SHEET</h1>
</div>
<div style="text-align: center;border-collapse: collapse;">
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-left: auto; margin-right: auto;">
<tr>
<td style="width: 20%;"><p class="s1">Offense Case #</p><input class="resize" type="text" id="txtOffenseCaseNum" name="txtOffenseCaseNum" value=""</td>
<td style="width: 20%;"><p class="s1">Master Incident #</p><input class="resize" type="text" id="txtMasterIncidentNum" name="txtMasterIncidentNum" value=""/></td>
<td style="width: 20%;"><p class="s1">Date of Occurrence</p><input class="resize" type="text" id="txtDateOfOccurrence" name="txtDateOfOccurrence" value="" /></td>
<td style="width: 20%;"><p class="s1">Time of Occurrence</p><input class="resize" type="text" id="txtTimeOfOccurrence" name="txtTimeOfOccurrence" value="09/23/2015 14:27:48" /></td>
<td style="width: 20%;"><p class="s1">Arresting Agency ORI</p><input class="resize" type="text" id="txtArrestingAgencyORI" name="txtArrestingAgencyORI" value="" /></td>
</tr>
</table>
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-left: auto; margin-right: auto;">
<tr>
<td colspan="9" class="s3a" style="width: 100%; background-color: black; color: white;text-align: center;">ARRESTED PERSON INFORMATION</td>
</tr>
<tr>
<td style="width: 24%;"><p class="s1">Name (Last, First, Middle)</p><input class="resize" type="text" id="txtName" name="txtName" value=""/></td>
<td style="width: 4%;"><p class="s1">Race</p><input size="2" type="text" id="txtRace" name="txtRace" value=""/></td>
<td style="width: 4%;"><p class="s1">Sex</p><input size="2" type="text" id="txtSex" name="txtSex" value=""/></td>
<td style="width: 4%;"><p class="s1">Height</p><input size="2" type="text" id="txtHeight" name="txtHeight" value=""/></td>
<td style="width: 4%;"><p class="s1">Weight</p><input size="2" type="text" id="txtWeight" name="txtWeight" value=""/></td>
<td style="width: 4%;"><p class="s1">Hair</p><input size="2" type="text" id="txtHair" name="txtHair" value=""/></td>
<td style="width: 4%;"><p class="s1">Eyes</p><input size="2" type="text" id="txtEyes" name="txtEyes" value=""/></td>
<td style="width: 17%;"><p class="s1">CIJS SID #</p><input class="resize" type="text" id="txtCIJSSIDNum" name="txtCIJSSIDNum" value="" /></td>
<td style="width: 17%;"><p class="s1">CIJS SPN #</p><input class="resize" type="text" id="txtCIJSSPNNum" name="txtCIJSSPNNum" value="" /></td>
</tr>
</table>
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-top: -1px;margin-left: auto; margin-right: auto;">
<tr>
<td style="width: 22%"><p class="s1">Address</p><input class="resize" type="text" id="txtAddress" name="txtAddress" value=""/></td>
<td style="width: 13%"><p class="s1">Unit Type</p><input class="resize" type="text" id="txtUnitType" name="txtUnitType" value=""/></td>
<td style="width: 13%"><p class="s1">Unit #</p><input class="resize" type="text" id="txtUnitNum" name="txtUnitNum" value=""/></td>
<td style="width: 13%"><p class="s1">Complexion</p><input class="resize" type="text" id="txtComplexion" name="txtComplexion" value=""/></td>
<td style="width: 13%"><p class="s1">Build</p><input class="resize" type="text" id="txtBuild" name="txtBuild" value=""/></td>
<td style="width: 13%"><p class="s1">Date of Birth</p><input class="resize" type="text" id="txtDateOfBirth" name="txtDateOfBirth" value=""/></td>
<td style="width: 13%"><p class="s1">Age</p><input class="resize" type="text" id="txtAge" name="txtAge" value=""/></td>
</tr>
</table>
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-top: -1px;margin-left: auto; margin-right: auto;">
<tr>
<td><p class="s1">City</p><input class="resize" type="text" id="txtCity" name="txtCity" value=""/></td>
<td><p class="s1">State</p><input class="resize" type="text" id="txtState" name="txtState" value=""/></td>
<td><p class="s1">Zip Code</p><input class="resize" type="text" id="txtZipCode" name="txtZipCode" value=""/></td>
<td><p class="s1">Primary Phone</p><input class="resize" type="text" id="txtPrimaryPhone" name="txtPrimaryPhone" value=""/></td>
<td><p class="s1">Secondary Phone</p><input class="resize" type="text" id="txtSecondaryPhone" name="txtSecondaryPhone" value=""/></td>
<td><p class="s1">Drivers License</p><input class="resize" type="text" id="txtDriversLicense" name="txtDriversLicense" value=""/></td>
<td><p class="s1">State</p><input class="resize" type="text" id="txtDriversLicenseState" name="txtDriversLicenseState" value=""/></td>
</tr>
<tr>
<td colspan="3"><p class="s1">Aliases / Nicknames / Maiden Name</p><input class="resize" type="text" id="txtAlias" name="txtAlias" value=""/></td>
<td colspan="2"><p class="s1">Place of Birth</p><input class="resize" type="text" id="txtPlaceOfBirth" name="txtPlaceOfBith" value=""/></td>
<td colspan="1"><p class="s1">Citizenship</p><input class="resize" type="text" id="txtCitizenship" name="txtCitizenship" value=""/></td>
<td colspan="1"><p class="s1">SSN</p><input class="resize" type="text" id="txtSocialSecurityNum" name="txtSocialSecurityNum" value=""/></td>
</tr>
<tr>
<td colspan="4"><p class="s1">Scars, Marks, Tattoos, Amputations</p><input class="resize" type="text" id="txtScars" name="txtScars" value=""/></td>
<td colspan="5"><p class="s1">Miscellaneous Number(s)</p><input class="resize" type="text" id="txtMiscNum" name="txtMiscNum" value=""/></td>
</tr>
</table>
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-top: -1px;margin-left: auto; margin-right: auto;">
<tr>
<td style="width: 20%;"><p class="s1">Occupation</p><input class="resize" type="text" id="txtOccupation" name="txtOccupation" value=""/></td>
<td style="width: 25%;"><p class="s1">Employer</p><input class="resize" type="text" id="txtEmployer" name="txtEmployer" value=""/></td>
<td style="width: 20%;"><p class="s1">Student</p>
<input type="radio" id="radioIsStudent" name="radioIsStudent" value="yes" />Yes
<input type="radio" checked id="radioIsStudent" name="radioIsStudent" value="no" />No
</td>
<td style="width: 20%;"><p class="s1">School</p><input class="resize" type="text" id="txtSchool" name="txtSchool" value=""/></td>
<td style="width: 10%"><p class="s1">Education Level</p><input class="resize" type="text" id="txtEducationLevel" name="txtEducationLevel" value=""/></td>
</tr>
<tr>
<td style="padding-bottom: 6px;"><p class="s1">Emergency Contact (Last, First)</p><input class="resize" type="text" id="txtEmergencyContact" name="txtEmergencyContact" value=""/></td>
<td style="padding-bottom: 6px;"><p class="s1">Address</p><input class="resize" type="text" id="txtContactAddress" name="txtContactAddress" value=""/></td>
<td style="padding-bottom: 6px;"><p class="s1">City</p><input class="resize" type="text" id="txtContactCity" name="txtContactCity" value=""/></td>
<td style="padding-bottom: 6px;"><p class="s1">State</p><input class="resize" type="text" id="txtContactState" name="txtContactState" value=""/></td>
<td style="padding-bottom: 6px;"><p class="s1">Zip Code</p><input class="resize" type="text" id="txtContactZip" name="txtContactZip" value=""/></td>
</tr>
</table>
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-top: -1px;margin-left: auto; margin-right: auto;">
<tr style="background-color: black; color: white;border: none;">
<td class="s3a" style="width: 20%;border: none;">OFFENSE CODE</td>
<td class="s3a" style="width: 35%;border: none;">CHARGE DESCRIPTION</td>
<td class="s3a" style="width: 20%;border: none;">WARRANT #</td>
<td class="s3a" style="width: 5%;border: none;">WARRANT TYPE</td>
<td class="s3a" style="width: 20%;border: none;">ISSUED BY</td>
</tr>
<tr>
<td style="padding-top:5px;padding-bottom: 3px;"><input type="text" class="resize" id="txtOffenseCode1" name="txtOffenseCode1" value=""/> </td>
<td style="padding-top:5px;padding-bottom: 3px;"><input type="text" class="resize" id="txtChargeDescription1" name="txtChargeDescription1" value="" /></td>
<td style="padding-top:5px;padding-bottom: 3px;"><input type="text" class="resize" id="txtWarrantNum1" name="txtWarrantNum1" value="" /></td>
<td style="padding-top:5px;padding-bottom: 3px;"><input type="text" class="resize" id="txtWarrantType1" name="txtWarrantType1" value="" /></td>
<td style="padding-top:5px;padding-bottom: 3px;"><input type="text" class="resize" id="txtIssuedBy1" name="txtIssuedBy1" value="" /></td>
</tr>
<tr>
<td style="padding-top:5px;padding-bottom: 3px;"><input type="text" class="resize" id="txtOffenseCode1" name="txtOffenseCode1" value="000000000091100"/> </td>
<td style="padding-top:5px;padding-bottom: 3px;"><input type="text" class="resize" id="txtChargeDescription1" name="txtChargeDescription1" value="" /></td>
<td style="padding-top:5px;padding-bottom: 3px;"><input type="text" class="resize" id="txtWarrantNum1" name="txtWarrantNum1" value="" /></td>
<td style="padding-top:5px;padding-bottom: 3px;"><input type="text" class="resize" id="txtWarrantType1" name="txtWarrantType1" value="" /></td>
<td style="padding-top:5px;padding-bottom: 3px;"><input type="text" class="resize" id="txtIssuedBy1" name="txtIssuedBy1" value="" /></td>
</tr>
</table>
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-top: -1px;margin-left: auto; margin-right: auto;page-break-after: always;">
<tr>
<td colspan="9" class="s3a" style="width: 100%; background-color: black; color: white;text-align: center;">ARREST DETAILS</td>
</tr>
<tr>
<td colspan="2"><p class="s1">Location of Arrest</p><input type="text" class="resize" id="txtLocationOfArrest" name="txtLocationOfArrest" value="" /></td>
<td colspan="2"><p class="s1">Date of Arrest</p><input type="text" class="resize" id="txtDateOfArrest" name="txtDateOfArrest" value="" /></td>
<td colspan="2"><p class="s1">Time of Arrest</p><input type="text" class="resize" id="txtTimeOfArrest" name="txtTimeOfArrest" value="" /></td>
<td colspan="2"><p class="s1">District / RA</p><input type="text" class="resize" id="txtDistrictRA" name="txtDistrictRA" value="" /></td>
</tr>
<tr>
<td colspan="3"><p class="s1">Condition of Prisoner</p><input type="text" class="resize" id="txtConditionOfPrisoner" name="txtConditionOfPrisoner" value="" /></td>
<td colspan="3"><p class="s1">Special Needs</p><input type="text" class="resize" id="txtSpecialNeeds" name="txtSpecialNeeds" value="" /></td>
<td colspan="2"><p class="s1">Disposition</p><input type="text" class="resize" id="txtDisposition" name="txtDisposition" value="" /></td>
</tr>
</table>
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-left: auto; margin-right: auto;">
<tr>
<td width="15%"><p class="s1">Operate Vehicle</p><p class="s4">
<input type="radio" id="rdoOperateVehicle" name="rdoOperateVehicle" value="yes" />Yes
<input checked type="radio" id="rdoOperateVehicle" name="rdoOperateVehicle" value="no" />No
</td>
<td width="14%"><p class="s1">VIN or License Plate</p><input type="text" class="resize" id="txtVIN" name="txtVIN" value="" /></td>
<td width="14%"><p class="s1">Make</p><input type="text" class="resize" id="txtMake" name="txtMake" value="" /></td>
<td width="14%"><p class="s1">Model</p><input type="text" class="resize" id="txtModel" name="txtModel" value="" /></td>
<td width="14%"><p class="s1">Year</p><input type="text" class="resize" id="txtYear" name="txtYear" value="" /></td>
<td width="14%"><p class="s1">Color</p><input type="text" class="resize" id="txtColor" name="txtColor" value="" /></td>
<td width="14%"><p class="s1">Hazardous Material</p>
<input type="radio" id="rdoHazardousMaterial" name="rdoHazardousMaterial" value="yes"/>Yes
<input checked type="radio" id="rdoHazardousMaterial" name="rdoHazardousMaterial" value="no" />No
</td>
</tr>
</table>
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-top: -1px;margin-left: auto; margin-right: auto;">
<tr>
<td style="width: 25%;"><p class="s1">Vehicle Impounded</p><p class="s4">
<input type="radio" id="rdoVehicleImpounded" name="rdoVehicleImpounded" value="yes" />Yes
<input checked type="radio" id="rdoVehicleImpounded" name="rdoVehicleImpounded" value="no" />No
</td>
<td style="width: 50%;"><p class="s1">Location</p><input type="text" class="resize" id="txtImpoundLocation" name="txtImpoundLocation" value="" /></td>
<td style="width: 25%"><p class="s1">Phone #</p><input type="text" class="resize" id="txtImpoundPhone" name="txtImpoundPhone" value="" /></td>
</tr>
<tr>
<td><p class="s1">Property in Property Room</p>
<input type="radio" id="rdoPropertyRoom" name="rdoPropertyRoom" value="yes"/>Yes
<input checked type="radio" id="rdoPropertyRoom" name="rdoPropertyRoom" value="no"/>No
</td>
<td><p class="s1">Location</p><input type="text" class="resize" id="txtPropertyLocation" name="txtPropertyLocation" value="" /></td>
<td><p class="s1">Phone #</p><input type="text" class="resize" id="txtPropertyPhone" name="txtPropertyPhone" value="" /></td>
</tr>
</table>
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-top: -1px;margin-left: auto; margin-right: auto;">
<tr>
<td colspan="5" class="s3a" style="width: 100%; background-color: black; color: white;text-align: center;">VICTIM NOTIFICATION</td>
</tr>
<tr>
<td style="width: 20%"><p class="s1">Victim Notification Phone #</p><input type="text" class="resize" id="txtVictimPhone" name="txtVictimPhone" value="" /></td>
<td style="width: 20%;"><p class="s1">VINE PIN #</p><input type="text" class="resize" id="txtVinePin" name="txtVinePin" value="" /></td>
<td style="width: 20%;"><p class="s1">Victim Declines Notification</p>
<input type="radio" id="rdoDeclinesNotification" name="rdoDeclinesNotification" value="yes" />Yes
<input checked type="radio" id="rdoDeclinesNotification" name="rdoDeclinesNotification" value="no">No
</td>
<td colspan="2" style="width: 40%"><p class="s1">Comments</p><input type="text" class="resize" id="txtVictimComments" name="txtVictimComments" value="" /></td>
</tr>
<tr>
<td colspan="5" class="s3a" style="width: 100%; background-color: black; color: white;text-align: center;">FACTS OF ARREST</td>
</tr>
<tr>
<td style="width: 30%;"><p class="s1">Arresting Agency</p><input type="text" class="resize" id="txtArrestingAgency" name="txtArrestingAgency" value="" /></td>
<td style="width: 30%;"><p class="s1">Address</p><input type="text" class="resize" id="txtArrestingAddress" name="txtArrestingAddress" value="" /></td>
<td style="width: 20%;"><p class="s1">City</p><input type="text" class="resize" id="txtArrestingCity" name="txtArrestingCity" value="" /></td>
<td style="width: 10%;"><p class="s1">State</p><input type="text" class="resize" id="txtArrestingState" name="txtArrestingState" value="" /></td>
<td style="width: 10%;"><p class="s1">Zip Code</p><input type="text" class="resize" id="txtArrestingZip" name="txtArrestingZip" value="" /></td>
</tr>
</table>
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-top: -1px;margin-left: auto; margin-right: auto;">
<tr>
<td style="width: 30%;"><p class="s1">Complainant / Victim Name</p><input type="text" class="resize" id="txtComplaintantName" name="txtComplaintantName" value="" /></td>
<td style="width: 30%;"><p class="s1">Address</p><input type="text" class="resize" id="txtComplaintantAddress" name="txtComplaintantAddress" value="" /></td>
<td style="width: 20%;"><p class="s1">City</p><input type="text" class="resize" id="txtComplaintantCity" name="txtComplaintantCity" value="" /></td>
<td style="width: 10%;"><p class="s1">State</p><input type="text" class="resize" id="txtComplaintantState" name="txtComplaintantState" value="" /></td>
<td style="width: 10%;"><p class="s1">Zip Code</p><input type="text" class="resize" id="txtComplaintantZip" name="txtComplaintantZip" value="" /></td>
</tr>
<tr>
<td style="width: 30%;"><p class="s1">Witness Name</p><input type="text" class="resize" id="txtWitnessName" name="txtWitnessName" value="" /></td>
<td style="width: 30%;"><p class="s1">Address</p><input type="text" class="resize" id="txtWitnessAddress" name="txtWitnessAddress" value="" /></td>
<td style="width: 20%;"><p class="s1">City</p><input type="text" class="resize" id="txtWitnessCity" name="txtWitnessCity" value="" /></td>
<td style="width: 10%;"><p class="s1">State</p><input type="text" class="resize" id="txtWitnessState" name="txtWitnessState" value="" /></td>
<td style="width: 10%;"><p class="s1">Zip Code</p><input type="text" class="resize" id="txtWitnessZip" name="txtWitnessZip" value="" /></td>
</tr>
</table>
<table border="1" cellspacing="0" style="border-collapse:collapse; width: 90%;margin-top: -1px;margin-left: auto; margin-right: auto;">
<tr>
<td style="width: 8%;"><p class="s1">Badge</p><input type="text" class="resize" id="txtArrestingBadge1" name="txtArrestingBadge1" value="" /></td>
<td style="width: 17%;"><p class="s1">Arresting Officer 1</p><input type="text" class="resize" id="txtArrestingOfficer1" name="txtArrestingOfficer1" value="" /></td>
<td style="width: 8%;"><p class="s1">Badge</p><input type="text" class="resize" id="txtArrestingBadge2" name="txtArrestingBadge2" value="" /></td>
<td style="width: 17%;"><p class="s1">Arresting Officer 2</p><input type="text" class="resize" id="txtArrestingOfficer2" name="txtArrestingOfficer2" value="" /></td>
<td style="width: 8%;"><p class="s1">Badge</p><input type="text" class="resize" id="txtTransportBadge" name="txtTransportBadge" value="" /></td>
<td style="width: 17%;"><p class="s1">Transporting Officer</p><input type="text" class="resize" id="txtTransportOfficer" name="txtTransportOfficer" value="" /></td>
<td style="width: 8%;"><p class="s1">Badge</p><input type="text" class="resize" id="txtApprovingBadge" name="txtApprovingBadge" value="" /></td>
<td style="width: 17%;"><p class="s1">Approving Officer</p><input type="text" class="resize" id="txtApprovingOfficer" name="txtApprovingOfficer" value="" /></td>
</tr>
</table>
<h3>SHERIFFS OFFICE
<span style="padding-left: 2%;padding-right: 2%;" class="s6">♦</span>
<span class="s7"> </span>200 MAIN <span style="padding-left: 2%; padding-right: 2%;" class="s6">♦</span>
<span class="s7"> </span>SOMEWHERE, SOMESTATE 00000
</h3>
<h2>Mental Health Diversion Questions</h2>
<table border="0" class="s9" cellspacing="0" style="width: 99%;margin-top: -1px;margin-left: auto; margin-right: auto;">
<tr style="border:none;">
<td style="width: 70%;border: none;text-align: left;margin-left: 20%;">
1. Have you ever been diagnosed as having a mental illness by a doctor or a mental health professional? (Check 1)
</td>
<td style="width: 30%;border: none;">
<input type="radio" id="rdoDiagnosedMental" name="rdoDiagnosedMental" value="yes" />Yes
<span class="s9"> </span>
<input checked type="radio" id="rdoDiagnosedMental" name="rdoDiagnosedMental" value="no" />No
</td>
</tr>
<tr>
<td style="width: 70%;border: none;text-align: left;margin-left: 20%;">
2. Have you ever or are currently taking any medications for mental illness? (Check 1)
</td>
<td style="width: 30%;border: none;">
<input type="radio" id="rdoTakingMeds" name="rdoTakingMeds" value="yes" />Yes
<span class="s9"> </span>
<input checked type="radio" id="rdoTakingMeds" name="rdoTakingMeds" value="no" />No
</td>
</tr>
<tr>
<td style="width: 70%;border: none;text-align: left;margin-left: 20%;">
3. Have you ever tried to kill yourself? (Check 1)
</td>
<td style="width: 30%;border: none;">
<input type="radio" id="rdoTriedKillSelf" name="rdoTriedKillSelf" value="yes" />Yes
<span class="s9"> </span>
<input checked type="radio" id="rdoTriedKillSelf" name="rdoTriedKillSelf" value="no" />No
</td>
</tr>
<tr>
<td style="width: 70%;border: none;text-align: left;margin-left: 20%;">
4. Do you currently have thoughts of killing yourself? (Check 1)
</td>
<td style="width: 30%;border: none;">
<input type="radio" id="rdoKillThought" name="rdoKillThought" value="yes" />Yes
<span class="s9"> </span>
<input checked type="radio" id="rdoKillThought" name="rdoKillThought" value="no" />No
</td>
</tr>
</table>
<br/>
<div style="width: 100%;text-align: center;">
***These questions are to be asked to arrested person as by required by procedure 601, and a Directive issued by the Sheriff?s Office.***
<br/>
<div class="printButton" style="width: 100%; text-align: center;">
<button onclick="window.print()">Print</button>
</div>
</div>
</p>
</div>
</body>
答案 0 :(得分:1)
我认为您需要关闭文档才能在写入文档后使用它。
var win = window.open();
win.document.write(data);
win.document.close();
使用主文档时不需要这样做,因为当dom完成解析时它将自动关闭,但是当你打开一个新窗口并写入它时你必须这样做。