I am using Javascript to display an 8*8 grid in a Sharepoint page. The code basically fetches the data from an array, creates a table with the data and adds it to the page when it first loads. It also adds onmouseout
and onmouseover
attributes to each cell of the table, which call 2 different Javascript functions:
- to add a description to a div underneath the table
- to remove the description
This Javascript performs fast on a simple HTML page and it works great in all browsers. Then I try to test it to our Sharepoint site and notice the following:
- On our reference environment the Javascript performs as expected: fast (even in IE7)
- On our production environment the Javascript is extremely sluggish on IE7 (not the MF3 or IE8). However, other parts of the page are slow too! If I hover on top of a link in takes some noticeable time before it is underlined. I removed the Javascript, and the results were almost similar.
What I do not understand, is whether the major problem is the Javascript itself OR our Sharepoint implementation (since we have different performance results in the two environments)?
I use some jQuery methods for simplicity:
//$str = the string that contains the HTML code for the table
function printTable(){
$("#whoswhotab").append($str);
}
function HideContent(d) {
$(d).empty();
}
function ShowContent(d) {
//fetch data from array and then append
$(d).append();
}
Thank you for your time.