balazs-endresz / jquery-translate

Automatically exported from code.google.com/p/jquery-translate
5 stars 5 forks source link

Out of memory error on IE6 #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Comment by mbasil7:

When i choose to translate the page in a language from the select, appears 
an alert: Out of memory at line:22

The website is http://www.psarema-skafos.gr and my code is

function translateTo( destLang ){
  $('body').translate('el',destLang, {
      not:          '.jq-translate-ui',
      start:        function(){$('#translate_loading').show();},
      complete:     function(){$('#translate_loading').hide();},
          fromOriginal:true
      }
  );
  $('title').translate(destLang)
}

$(document).ready(function(){
        $.translate(function(){
        $('#translate_loading').hide();
        $.translate.ui({
        tags: ['select', 'option'],
        filter: ["el","en", "de", "fr","it","tr"],
                label: $.translate.toNativeLanguage ||
         function(langCode, lang){
           return $.translate.capitalize(lang);
         },
                fromOriginal:true
     })
     .change(function(){
                var lang = $(this).val();
                translateTo(lang);
        $.cookie('destLang', lang, {path:'/'});
        })
        .val('el')
        .appendTo('#translate'); //insert the dropdown to the page
    $.translate.getBranding().appendTo($('#translate'));
        var destLang = $.cookie('destLang');
        if (destLang && destLang != 'el') {
                //alert(destLang);
                $('.jq-translate-ui').val(destLang);
                translateTo( destLang );
     }
    });

});

Original issue reported on code.google.com by balazs.endresz on 30 Mar 2010 at 5:38

GoogleCodeExporter commented 9 years ago

Original comment by balazs.endresz on 30 Mar 2010 at 5:42

GoogleCodeExporter commented 9 years ago
There's a few recursive function calls returning nothing (in the internal 
`process` 
method) and for me IE6 says "Out of stack space", which is basically the same 
thing. 
But this is beyond me, I don't see how I could fix this or why is this an issue 
at all. 
Though you can try the `async:true` option, or use the `translateTextNodes` 
method 
instead of `translate`.

Original comment by balazs.endresz on 30 Mar 2010 at 6:12

GoogleCodeExporter commented 9 years ago
The problem solved by using the `translateTextNodes` method 
instead of `translate`.

Thanks for your help again!

Original comment by mbas...@gmail.com on 30 Mar 2010 at 11:47

GoogleCodeExporter commented 9 years ago
Same problem here as well: 
http://educacion.knowleer.org/ptr/vista/vptr002/index.html

Original comment by balazs.endresz on 14 Apr 2010 at 5:38

GoogleCodeExporter commented 9 years ago

Original comment by balazs.endresz on 11 Mar 2011 at 8:06