On 6. des. 2005, at 22.52, Bob Ippolito wrote:



On Dec 6, 2005, at 1:48 PM, Rune Hansen wrote:

Working with MochiKit is fun. Working with IE on the other hand..

I have, for the time being, hit a show stopper (for this particular application anyway):
Using this code:
     return TABLE({'class':'grid','id':'swaptable'},
        THEAD(null, TR(null, TD(null,'ID'),TD(null,'NAME'),TD(null,'ACTIVE'))),
        TFOOT(null, TR(null, TD())),
        TBODY(null, map(table_row, rows))
         );
I'm swapping DOMs to my hearts content - that is, when using Firefox/Safari and so on.
(I'm calling methods to update data in database and I need to reload and swap the DOM for each update)
With IE I get the DOM once. And once more after I restart the browser.

Does anyone know of a way to force IE to call the method again?

You might just want to try having the table in the HTML, and doing replaceChildNodes("tbody_id", map(table_row, rows))

Anyway, you didn't show enough code to reproduce the problem... so it's kinda hard to say much else.

-bob

Hi Bob,
This is the complete _javascript_ and HTML: 

    function styledTable(styles, rows, id) {
        var styleIter = cycle(styles);
        var table_row = function(row) {
            return TR({'class': styleIter.next()},map(partial(TD,{'style':'text-align:left'}),row));
        };

     return TABLE({'class':'grid','id':id},
        THEAD(null, TR(null, TD(null,'ID'),TD(null,'NAME'),TD(null,'ACTIVE'))),
        TFOOT(null, TR(null, TD())),
        TBODY(null, map(table_row, rows))
         );

    };

    function requestSourceColl() {
alert(document.getElementById('scoll').style.display);
        if (document.getElementById('scoll').style.display=="block"){
            var d = loadJSONDoc("${std.url('/Edit/', pageid=pageid,view=view,tg_format='json')}");
            d.addCallback(showSourceColl);
        }
    }
    function showSourceColl(result){
        swapDOM("sourcecoll",styledTable(['odd','even'],result['sourcecoll'],'sourcecoll'))
    }
   
<a href="" py:attrs="style='cursor:hand;'" >Source list</a>

 <div py:attrs="style='display:none;',id='scoll'">
<table class="grid" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" style="text-align:center;background-color:#6FB8C6;">
Source
</td>
 </tr>
<tr>
<td>
<table id="sourcecoll" />
</td>
<td>
Source list
</td>
</tr>
</table>
</div>

The soho("scoll") method is a basic set visibility script.

My problem is that IE calls the loadJSONDoc in function requestSourceColl once and only once. It seems like it's cached somehow. The alert message in the function is displayed every time.

I have set   <META HTTP-EQUIV="Pragma" CONTENT="no-cache"/>, <META HTTP-EQUIV="Expires" CONTENT="-1"/> which according to microsoft.com should negate any form of caching.

regards
/rune

---------------------------------------------------------------------

Behind the firewall, nobody can hear you scream...


Reply via email to