javascript - <span> html duplicate print out -


i new using span . trying print out information javascript script twice on same page.

i can print information once when decide print information second time doesn't display it

this 1 works

    <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 />  &nbsp;<h6> report id : </h6> &nbsp; <span id="reportid"></span> <br />  &nbsp;<h6> description : </h6> &nbsp; <span id="description"></span><br />  &nbsp;<h6> category : </h6> &nbsp; <span id="category"></span>  <br/>     &nbsp;<h6> date , time : </h6> &nbsp; <span id="datetime"></span> <br />  &nbsp;<h6> user id/ mobile number : </h6> &nbsp; <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> 

but when copy same div on same page different location not display information

    <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 />  &nbsp;<h6> report id : </h6> &nbsp; <span id="reportid"></span> <br />  &nbsp;<h6> description : </h6> &nbsp; <span id="description"></span><br />  &nbsp;<h6> category : </h6> &nbsp; <span id="category"></span>  <br/>     &nbsp;<h6> date , time : </h6> &nbsp; <span id="datetime"></span> <br />  &nbsp;<h6> user id/ mobile number : </h6> &nbsp; <span id="userid"></span><br />     <br />  </div> 

this javascript requested

</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> 

i've spotted several issues far:

  • you've got duplicate id's, isn't allowed.
  • you think you're adding you're adding elements somewhere else, you're positioning them absolutely, they're bound overlap
  • you're leaving <span> elements empty, yet add &nbsp; in between tags... you've got tag-soup in making
  • the first code has form @ end, second doesn't. seeing overlap, second bunch of nodes might remain tucked away ever.
  • your javascript code contains 2 (huuuge) functions, aren't being called afaik. might come across rude/arrogant please, tidy code suggested in faq
  • you're messing z-index, why?

but none of these guesses come close being conclusive long you're not showing javascript code. if you're using document.write('your-html');, example, can tell that's problem , go our ways evermore... please set decent fiddle or something


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -