私はスパンを使用するのは初めてです。javascriptスクリプトから取得した情報を同じページに2回印刷しようとしています。
一度取得した情報は印刷できますが、2回目に印刷しても表示されません。
これは動作します
<div id="layer4" class="auto-style10" style="position: absolute; width: 300px; height: 427px; z-index: 2; left: 1020px; top: 90px">
<span class="auto-style8"><h4>Incident Details</h4><br />
</span>
<br />
<h6> Report ID : </h6> <span id="ReportID"></span> <br />
<h6> Description : </h6> <span id="Description"></span><br />
<h6> Category : </h6> <span id="Category"></span> <br/>
<h6> Date and Time : </h6> <span id="DateTime"></span> <br />
<h6> User Id/ Mobile Number : </h6> <span id="UserID"></span><br />
<br />
<span id="ReportID"></span>
<form method="post" action="http://www.al-qarra.com/police_new/map2/changelevel.php" >
<select name="SelectCat" style="position: absolute; width: 60px; z-index: 2;">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<input name="reportno" type="hidden" value="<?php echo $_SESSION['incidentid']; ?>">
<input name="ChangeCat" id="SelectCat" type="submit" value="Change Status" style="position: absolute; left: 100px; width: 110px; z-index: 2;"/>
</form>
</div>
しかし、同じdivを同じページにコピーしても、場所が異なると、情報が表示されません。
<div id="layer44" class="auto-style10" style="position: absolute; width: 300px; height: 427px; z-index: 2; left: 1020px; top: 300px">
<span class="auto-style8"><h4>Incident Details</h4><br />
</span>
<br />
<h6> Report ID : </h6> <span id="ReportID"></span> <br />
<h6> Description : </h6> <span id="Description"></span><br />
<h6> Category : </h6> <span id="Category"></span> <br/>
<h6> Date and Time : </h6> <span id="DateTime"></span> <br />
<h6> User Id/ Mobile Number : </h6> <span id="UserID"></span><br />
<br />
</div>
これは要求された私のJavaScriptです
</style>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
$("#ReportID").text(nreportid);
$("#Description").text(ndesc);
$("#Category").text(ncat);
}
</script>