开发者

jquery .load() and IE

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( functio开发者_开发问答n() {
$('#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


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


You're fighting the browser cache.

Change it to

.load("/Admin/UpdateCustomerList?Timestamp=" + new Date())
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜