javascript - How to pass an object in this case? -


i have page "left" div, contains menu, , "right" div, holds content changes, loaded using javascript in:

document.getelementbyid("content").innerhtml='<object type="text/html" data="templates/login.htm"> </object>'; 

it works okay first time click link on left menu. now, new loaded content has inputs should same thing. seems can't see "content" div having id, or else. how accomplish this? (fixed menu on left, , on right have changing content - have several inputs well). thanks.

addendum - contents of js function line pasted above. flow clarify? step 1 - load menu on left , initial content on right. no user intervention step 2 - click "login" on left menu. login page (separate html) loaded on right side. fine. step 3 - click "cancel" in newly loaded login menu on right side... nothing happens, despite button having the exact same onclick left side menu had (the 1 used load login scren in step 2)

when tracing through parents of "cancel" button, trace never "saw" div. output of "parent hunting" object htmlparagraphelement (button in

) object htmltablecellelement object htmltablerowelement object htmltablesectionelement object htmltableelement (so far good... should table containing button clicked) object htmlbodyelement (mmm shouldn't have div here?) object htmlhtmlelement object htmldocument null

(now... shouldn't have div between body , table elements?) seems partial html loaded inside div cannot see it?

if code-sample used in project, missing > might source of troubles.

document.getelementbyid("content").innerhtml='<object type="text/html" data="templates/login.htm"></object>'; 

Comments