views:

171

answers:

1

I have an issue with frameset breaking down and I have gotten a little help here on the forum. Now I have finally tracked down when things go south so here is my current problem.

1 I have a frameset with Top, Menu and Main 2. Links in Menu open views in Main 3. This breaks down on saving documents in Main. After saving all links in Menu will open in new window.

BUT - And here is the really strange thing that I have discovered after two days of checking base target and such.

I ONLY breaks down if I change a value that fires an Ajax call. If I add a comment in the comment field or if I change a number value all is good. I can save and the frameset is intact and fine. If I change a drop down list that fires an Ajax call before saving, then my frameset breaks down.

This is IE (7 and 8) only and Firefox does not have this problem.

This is an example of my Ajax code (I have about 4 different calls)

function fillUtmelding(refnr){
                 var f = document.forms[0];

     var url = getDbUrl() + '/(FinnBeholdningValg)?OpenAgent&refnr=' + refnr + "&dbid=C1256B7D0033B1DF" + "&" + Math.round(Math.random() * 500);

       var fondOppslag = new Ajax.Request(url, {
        method: 'get',
        onComplete: function(req){
            var liste = req.responseText;

            var startListe = liste.split(';');

                arrListe = startListe[0].split('$');
                                                               f.f.value = arrListe[0];
                                                               f.fisin.value = arrListe[1];
                                                               f.andeler.value = arrListe[2];

            for (j = 1; j < 14; j++) {
                name = "f_" + j;
                fisin = "fisin_"+ j;
                                                               andeler = "andeler_" +j;                                             

                    var nyListe = startListe[j].split('$')

                    if (nyListe[1] != 'Plassering'){
                                                                              f[name].value = nyListe[0];
                                                                              f[fisin].value = nyListe[1];
                                                                              f[andeler].value = nyListe[2];
                                                                              }

            }
        }
    });
}

Edit: I have no problems with the ajax calls as far as I can see. I get values back and use them as intended. Could there be some keepAlive setting or something that is doing this?

A: 

Somewhere in the JS code from right frame there was a function inside which was:

name = "(something)";

Of course without var specified. IE went mad, because it looks like this simple line changed frame name.... then when click on the other frame it couldn't find it thus opens content in new window.

Problem fixed.

PS. Be careful what You are using for variable name :)

Rafal Ziolkowski