<div> tag ...yes IE no Firefox

Discussion in 'JavaScript' started by motheherder, Oct 6, 2006.

  1. #1
    I have an application using a series of HTML frames.

    In 'frame_X' I have a <div> tag with id="showdata"

    Once an event happens in 'frame_A' I need to update the contents of the <div> tag in 'frame_X'.

    I use the following line of code located in 'frame_A' to do this

    if (this.happens)
    {
    parent.frame_X.showdata.innerHTML = newdatareceivedfromframe_A;
    }

    This works fine in IE > v4 but does not work at all in Firefox (Netscape > v5). Is it possible to get this to work in Firefox and if not, is there a work around?

    Any assistance is much appreciated

    mo
     
    motheherder, Oct 6, 2006 IP
  2. zerohex

    zerohex Peon

    Messages:
    19
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This should work in Firefox. Have you tried different versions of the browsers?

    zerohex
     
    zerohex, Oct 8, 2006 IP
    motheherder likes this.
  3. motheherder

    motheherder Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    zerohex

    thanks for the response, I have not tried different versions of the browsers as these are the only versions available to our internal users.

    I have tried relocating the function out of the .htm file into a .js file thinking firefox might be tripping on the location relative to the frame structure but this has made no difference.

    any suggestions

    mo
     
    motheherder, Oct 9, 2006 IP
  4. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You need to use the document.frames array to reference a frame. Although I strongly suggest you avoid their use altogether.
     
    penagate, Oct 9, 2006 IP
    motheherder likes this.
  5. motheherder

    motheherder Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the input penagate

    As much as I would like to dump the frames in favour of a more robust solution, the application I am using is riddled with them and relies on them to function.

    The <div> tags seem to be the problem and are not recognised by firefox although a little more time on the reference paths might sort this out. Unfortunately I have a deadline for this so dont have too much time to investigate.

    In the mean while I have found a work around, it seems that accessing images is not a problem, although this is not ideal and has serious limitations on the information that can be received, in my case the response needs to be one of ten numeric values. I have simply created images of each of the ten values and will call these at the appropriate time. As mentioned, not ideal, but is a quick fix and provides a working solution and the user will be none the wiser. I am hoping to revisit this once up and running and get it working properly.

    Thanks for the advice

    mo
     
    motheherder, Oct 11, 2006 IP
  6. Logic Ali

    Logic Ali Well-Known Member

    Messages:
    170
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #6
    Try:
    parent.frames.frame_X.document.getElementById('showdata').innerHTML=
    Code (markup):
     
    Logic Ali, Oct 11, 2006 IP
  7. Logic Ali

    Logic Ali Well-Known Member

    Messages:
    170
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #7
    That will fail in FireFox. Always use window.frames
     
    Logic Ali, Oct 11, 2006 IP
  8. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #8
    window.frames, apologies.
     
    penagate, Oct 11, 2006 IP