I have a calendar asp page that users schedule times and everyone's times are displayed on this table (similar to Google calendar but only month view). I have it up and running and it works great but I need to edit the page on printing to ensure everything fits on one page. The table is generated through an ASP loop but here is basic structure
<table id='calendar' class="cal">
<tr class="cal">
<td class="cal" onclick="shoForm('5_10');">10
<div class="cellDiv" id="5_10"></div>
</td>
</tr>
</table>
I populate this table using jQuery and AJAX so an example item under one of the cells could be like so:
<div id='1' class='item'>
<span name='itmUserName' id='User1'>User1</span>
<span class='dnPrint'><br/></span>
Project: <span name='tasks' id='2'>Reviewing</span>1.5 hrs
</div>
In jQuery, then I append items to cells like so (where curItemDay
is the date for the item):
$("#"+curItemDay).append(
"<div id='"...see above.../div>"
);
Now this all works fine and dandy and visually the web page loads perfect. However, I am trying to hide certain pieces when they click on a "Print" button.
function printThis(){
var names=document.getElementsByName("itmUserName");
for(var i=0;i<names.length;i++){
if(names[i].innerHTML.split(" ").length>1)
names[i].innerHTML=names[i].innerHTML.charAt(0)+names[i].innerHTML.split(" ")[1].charAt(0);
names[i].innerHTML="["+names[i].innerHTML+"] ";
}
...more code....
}
This works fine in FF but in IE it does not work. When I look through the code in IE using the developer console (F12) it doesn't even show the items that were added via jQuery. The page loads and displays everything, but the code doesn't seem to be reflecting what is on the page.
<td class="cal" onclick="shoForm('5_16');">
Text - 16
<div class="cellDiv" id="5_16"/>
</td>
NOTE: IE version is 8.0.6001.18702