views:

41

answers:

2

Hi there,

Tested the below code with FF, Safary and Chrome and all works ok. But with IE... not so When the button "viewEditButID'" is click the div "customerDetailsDivClass" is hidden. When it's click again the div reapers but before it dose so it download the data is going to display.

$(document).ready( function() {
$('#viewEditButID').click( function()
{
   if ($('div.customerDetailsDivClass').is(':visible'))
   {
     $('div.customerDetailsDivClass').toggle("slow");
   }
  else
  {
     //Will make the box visible so update the date before this is done
    $("div.customerDetailsDivClass").load("/Admin/UpdateCustomerList");
     $('div.customerDetailsDivClass').toggle("slow");
   }
});
});

html

<div class="customerDetailsDivClass">
<table id="customerTable">
  <tr><th>Customer Name</th><th>Customer Code</th><th></th></tr>
  <tr class="evenRow">
    <td>Customer 1</td>
    <td>SADFHS12345</td>
    <td class="noRightPad"><input type="submit" name="createBut" value="View/Edit"/></td>
</tr>
<tr>
  <td>Customer 2</td>
  <td>SADFHS67891</td>
  <td class="noRightPad"><input type="submit" name="createBut" value="View/Edit"/></td>
</tr>
</table>
</div>

From there a servlet is called and redirects the request to a .jsp which response with only the following:

<table id="customerTable">
<tr>
  <th>Customer Name</th><th>Customer Code</th><th></th>
</tr>
<tr class="evenRow">
  <td>Customer 2</td>
  <td>SADFHS12345</td>
  <td class="noRightPad"><input type="submit" name="createBut" value="View/Edit"/></td>
</tr>
<tr>
  <td>Customer 2</td>
  <td>SADFHS67891</td>
  <td class="noRightPad"><input type="submit" name="createBut" value="View/Edit"/></td>
</tr>
</table>

So like i mention in FF the table is updated with Customer 2 data, but with IE the old data (Customer 1 data) is presented back again.

Any help, hints to toubleshoot would be great!

Thanks Alexis

A: 

You're fighting the browser cache.

Change it to

.load("/Admin/UpdateCustomerList?Timestamp=" + new Date())
SLaks
Thanks for the reply.I found this issue at this bloghttp://zacster.blogspot.com/2008/10/jquery-ie7-load-url-problem.htmlI tried using:$("div.customerDetailsDivClass").load("/Admin/UpdateCustomerList?" + Math.random()*99999);but still the same issue..plus looking at the server log the https request from IE is hitting the server..alexis
alexis
+2  A: 

manage to resolve this...

after a day of wasted time and swearing at the IE developers..

there was a blank line "\n" in my .jsp file which (only) IE interprets this as end of file rather then looking at the byte count in the http header..

anyway i learn allot about js debugging at least

alexis

alexis