balazs-endresz/jquery-translate

IE 8 slow warning on page with many elements

GoogleCodeExporter opened this issue · 4 comments

jquery-translate version:1.3.9
jQuery version:1.5
browser: IE 8
OS: Windows 7 32bit

How do you handle the IE 8 Slow script warning? Has this happened to anyone 
else?

I have a large page to translate (the <asp:Literal ID="Literal1" 
runat="server">null</asp:Literal>        sets the language in the codebehind to 
whatever selected)

I do it with the below code 

<script type="text/javascript" >
    jQuery.noConflict();
    jQuery(document).ready(function () {
        var jQuerydestLang = null;

        jQuery.translate(function () {
            jQuery.fn.translateTo = function (destLang) { jQuery('#translateit').translate('english', destLang, { not: ' #ctl00_Menu1_ctl06_HyperLink2,#ctl00_fname,#ctl00_ftel,#ctl00_femail,#fmessage,#HyperLink9 ,#HyperLink10 ,#HyperLink11 ,#HyperLink12 ,#HyperLink13 ,#HyperLink14   ' }); return true; };
            jQuerydestLang = '<asp:Literal ID="Literal1" runat="server">null</asp:Literal>';

            if (jQuerydestLang) { jQuery.fn.translateTo(jQuerydestLang) };
        });
    });
</script>


Original issue reported on code.google.com by rodoj...@gmail.com on 22 Feb 2011 at 11:54

http://office.dfs.gr/pfashion if you want to see it in action

Original comment by rodoj...@gmail.com on 22 Feb 2011 at 1:20

async:true; didnt worked but translateTextNodes() worked fine, no slow script 
message now

Original comment by rodoj...@gmail.com on 22 Feb 2011 at 4:45

On some pages that can happen, just use the async:true option! It will take 
more time but won't freeze the browser. You can probably set it to false on 
other browsers if they don't complain about this. Also, you can try the 
jQuery('#translateit').translateTextNodes() method instead of 
jQuery('#translateit').translate().

Original comment by balazs.endresz on 22 Feb 2011 at 2:22

It really depends on the actual markup, but that's why translateTextNodes 
exists, it has much less computational complexity.

Original comment by balazs.endresz on 22 Feb 2011 at 9:30

  • Changed state: Done