Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    i have used Div within Div and tried calling it from javascript

    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
    Last edited by murali1983; 10-31-2006 at 05:56 AM.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,618
    Thanks
    0
    Thanked 645 Times in 635 Posts
    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.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    New Coder
    Join Date
    Oct 2006
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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....

  • #4
    New Coder
    Join Date
    Oct 2006
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i meant alternative for FRAMES which should be compatible for both IE and Firefox.

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    What in fact you want to do?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •