JavaScript speed problem

  • Thread starter Thread starter botski007
  • Start date Start date
B

botski007

One section of a page consists of about 1200 lines like this one:
<label class="checklist cl1" for="spdl0">
<input type="checkbox"
name="selected_districts"
value="value X"
onclick="some_js_Function( 'some_id', 'spdl0')"
id="spdl0"

class="checkLOC"some string
</label>

It takes about 6 seconds to display that part of the page. (Someone
said it takes much longer in ie 7.)
The slowness is associated with the "onclick" attributes - if we
remove them, this section loads very quickly.
(But, of course, the app won't run without them.)
Users are complaining now and when, the size of the list increases,
they will be furious.
Is there anything we can do to speed things up?
 
Hi Botski,

Place your onclink event in before the <body> tag

<SCRIPT LANGUAGE="JavaScript1.2">
//<!--
function doClick()
{
var el=document.AcitveElement;
.... use the el object to obtain the id and values of the currently active
element.
etc........
}
selected_districts.onClick = doClick;


Regards.
 
Hi Botski,

Place your onclink event in before the <body> tag

<SCRIPT LANGUAGE="JavaScript1.2">
//<!--
function doClick()
{
var el=document.AcitveElement;
... use the el object to obtain the id and values of the currently active
element.
etc........}

selected_districts.onClick = doClick;

Thanks! We'll give that a try.
 
Back
Top