Note that there are some explanatory texts on larger screens.

plurals
  1. POeval javascript function IE6 taking long time
    primarykey
    data
    text
    <p>I have the below chunk of code. I've debugged through and located the snippet that is causing a long delay in IE6.</p> <p>Basically the code loops through a document converting it to XML and sending to a PDF. On Ubuntu and Firefox 4 it takes 3 seconds. On IE it can take up to 40 seconds regularly.</p> <pre><code>/** * This function builds up the XML to be saved to the DM. */ function getXMLToSave(){ var text="&lt;workbook&gt;&lt;sheet&gt;&lt;name&gt;Adv4New&lt;/name&gt;"; //show_props(document.adv4.row10col1, "document.adv4.row10col1"); for(i=1;i&lt;157;i++){ text = text + "&lt;row number='" + i + "'&gt;"; for(j=1;j&lt;=7;j++){ text = text + "&lt;col "; //alert(eval('document.adv4.row'+i+'col'+j+'.readonly')); try{ text = text + "number='" + j + "' label='" + eval('document.adv4.row'+i+'col'+j+'.className')+ "'"; } catch (e) { text = text + "number='" + j + "' label=''"; } try { if(eval('document.adv4.row'+i+'col'+j).readOnly) text = text + " type='readonly'"; else text = text + " type=''"; } catch (e) { text = text + " type=''"; } try { text = text + " color='" + eval('document.adv4.row'+i+'col'+j+'.style.color') + "'"; } catch (e) { text = text + " color=''"; } text = text + "&gt;"; try { // don't wrap in a CDATA (like previously), but run cleanNode // this fixes html entities var content = eval('document.adv4.row'+i+'col'+j+'.value'); text = text + cleanNode(content); } catch (e) { text = text + "0"; } text = text + "&lt;/col&gt;"; } text = text + "&lt;/row&gt;"; } text = text + "&lt;/sheet&gt;&lt;/workbook&gt;"; return text; </code></pre> <p>}</p> <p>I believe its the eval function causing the delay in IE6. Is there a neat solution to fix this. Thanks very much</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload