...

View Full Version : i have used Div within Div and tried calling it from javascript



murali1983
10-31-2006, 06:53 AM
hii,
i have used Div with in Div and tryed calling it from javascript, its workin fine with IE...but in firefox its not not..it says "document.getElementById has no properties for first case " n "frames has no properties for second case " in the javascript console within firefox...

javascript
---------------------
1> var myBody1=document.getElementById('invDetails').document.getElementById('Coll');

2> var myBody1=frames['invDetails'].document.getElementById('Coll');

html
-------------
<table border="0" width="100%">
<tr style="font-size: 10pt;">
<td>&nbsp;&nbsp;</td>
<td>
<div id="invDetails" style=" height:88px ;width:98.5%;">
<div id="Coll" style="border:1px solid black; height:91
px; width:100%; overflow:auto; overflow-y:scroll; ">

<TABLE id="TABLE1" style="width:100%;" >

hope i can get a solution as soon as possible....

thnx
Murali

felgall
10-31-2006, 07:21 AM
Change it to:

var myBody1=document.getElementById('Coll');

it can access the inner div directly by the id and you don't have any frames.

murali1983
10-31-2006, 10:52 AM
can i know what is the alternative frames which should be compatible with firefox..

var myBody1=document.getElementById('Coll');

var myBody=myBody1.getElementsByTagName('tbody')[0];

row=myBody.appendChild(frames['Coll'].document.createElement('<tr ALIGN=CENTER>')); < ---- this line works fine with IE but not with firefox it throws frames.coll has no properties....

murali1983
10-31-2006, 12:12 PM
i meant alternative for FRAMES which should be compatible for both IE and Firefox.

Kor
11-22-2006, 10:41 AM
What in fact you want to do?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum