I am trying to have links on a left menu load into the main content page instead of opening a new window. For some reason, it works about 50% of the time, for no apparent reason. Here is the script. Please help!!!
unction handleOnLoading(){
var sAnchorHTML ="";
var main_trTag ="";
var second_trTag="";
var final_trTag ="";
oleftFrame = window.parent.document.frames("Links");
header_trTag = "<table cellpadding='0' cellspacing='0' class='.tableMenuItems'>";
main_trTag ="<tr> <a target='content.html' href= <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->";
second_trTag = "<td class='tdMenuItem' nowrap onmouseover='toggleMenuItem(this, true, false)' onmouseout='toggleMenuItem(this, false, false)' onclick='toggleMenuItem(this, false, true)'>";
final_trTag = "</td></a></a></tr>";
footer_trTag = "</table>";
if (value == "John Doe"){
my_links[0] = main_trTag + "'main.html'> " + second_trTag + "Home" + final_trTag;
my_links[1] = main_trTag + "'Link1.html'> " + second_trTag + "-Show Status" +final_trTag;
my_links[2] = main_trTag +"'Link2.html'> " +second_trTag + "-Revoke Access" +final_trTag;
}
else if(value== "Jane Doe"){
my_links[0] = main_trTag + "'main.html'> " + second_trTag + "Home" +final_trTag;
my_links[1] = main_trTag + "'Link1.html'> " + second_trTag + "-Show Status" +final_trTag;
my_links[2] = main_trTag + "'Link3.html'> " + second_trTag + "-Grant Access" +final_trTag;
my_links[3] = main_trTag +"'Link2.html'> " + second_trTag + "-Revoke Access" +final_trTag;
}
else{
my_links[0] = main_trTag + "'main.html'> " + second_trTag + "Home" +final_trTag;
}
for (i = 0; i < my_links.length; i++) {
sAnchorHTML += my_links;
}
oleftFrame.document.all("spnanchor").innerHTML = header_trTag + sAnchorHTML + footer_trTag;
}
unction handleOnLoading(){
var sAnchorHTML ="";
var main_trTag ="";
var second_trTag="";
var final_trTag ="";
oleftFrame = window.parent.document.frames("Links");
header_trTag = "<table cellpadding='0' cellspacing='0' class='.tableMenuItems'>";
main_trTag ="<tr> <a target='content.html' href= <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->";
second_trTag = "<td class='tdMenuItem' nowrap onmouseover='toggleMenuItem(this, true, false)' onmouseout='toggleMenuItem(this, false, false)' onclick='toggleMenuItem(this, false, true)'>";
final_trTag = "</td></a></a></tr>";
footer_trTag = "</table>";
if (value == "John Doe"){
my_links[0] = main_trTag + "'main.html'> " + second_trTag + "Home" + final_trTag;
my_links[1] = main_trTag + "'Link1.html'> " + second_trTag + "-Show Status" +final_trTag;
my_links[2] = main_trTag +"'Link2.html'> " +second_trTag + "-Revoke Access" +final_trTag;
}
else if(value== "Jane Doe"){
my_links[0] = main_trTag + "'main.html'> " + second_trTag + "Home" +final_trTag;
my_links[1] = main_trTag + "'Link1.html'> " + second_trTag + "-Show Status" +final_trTag;
my_links[2] = main_trTag + "'Link3.html'> " + second_trTag + "-Grant Access" +final_trTag;
my_links[3] = main_trTag +"'Link2.html'> " + second_trTag + "-Revoke Access" +final_trTag;
}
else{
my_links[0] = main_trTag + "'main.html'> " + second_trTag + "Home" +final_trTag;
}
for (i = 0; i < my_links.length; i++) {
sAnchorHTML += my_links;
}
oleftFrame.document.all("spnanchor").innerHTML = header_trTag + sAnchorHTML + footer_trTag;
}