Resources /
jQuery / Dynamic HTML in Frames with JavaScript
Dynamic HTML in Frames with JavaScript
Here's the code to add an "a" that is in an "li" that will be positioned in an existing "ul" and the "ul" is in a parent frame:
function AddMenuLI(name, Id)
{
//this is how you get the document of the parent frame
var menu_document = window.parent.menu.document;
//create the a and give it some attributes
var href = menu_document.createElement("a");
href.setAttribute("href", "EditMasterPage.aspx?Id=" + Id);
href.setAttribute("target", "rhs");
href.appendChild(menu_document.createTextNode(name));
var li = menu_document.createElement("li");
li.setAttribute("ID", "EditMasterPage_" + Id);
li.appendChild(href);
//find the ul" and position a child in it
var EditMasterPage_New = menu_document.getElementById("_MasterPages");
EditMasterPage_New.appendChild(li);
}