Problem with path between parent and child html pages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sosuko
    New Member
    • Feb 2009
    • 6

    Problem with path between parent and child html pages

    HI. I have a html page 'parent'. I have loaded an html page as 'child' through Object tag from parent html page.

    Parent html page has a function callF()

    I am trying to call callF() from child html page.

    So, the code in the child html page would be:
    parent.callF();

    While Google Chrome, Mozilla Firefox process the above code smoothly, Internet Explorer 6 & 7 gives error
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    When you talk about child and parent, do you mean windows or frames/iframes?

    Some code may help pinpoint the problem.

    PS. welcome to Bytes!

    Comment

    • sosuko
      New Member
      • Feb 2009
      • 6

      #3
      Thanks acorder :)

      I mean to say I have used Object tag, instead of IFrame tag.

      Code:
      function helpClicked() {
        this.document.getElementById('leftContent_div').innerHTML = '<'+'object id="homeComp" name="homeComp" type="text/html" data="help_left.html" width="604" height="690"><\/object>';
      }
      This is the function I am calling from child html page. The child html page itself is loaded with Object tag.

      Please solve my problem.
      Last edited by acoder; Feb 13 '09, 08:06 AM. Reason: Added [code] tags

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Why not use an iframe? Any particular reason?

        Comment

        • sosuko
          New Member
          • Feb 2009
          • 6

          #5
          HI Acoder, sorry for replying so late.

          I used an iFrame tag still its the same problem.

          I have attached the two html files, please give me some solution.
          Attached Files

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            If I change the object to an iframe, it works:
            Code:
            <iframe id="homeComp" src="child.html" width="400" height="400"></iframe>

            Comment

            • sosuko
              New Member
              • Feb 2009
              • 6

              #7
              Hi Acoder,

              THANK you so much for your help, now my code is working fine on all browsers.
              I am relieved as the project on which I am working is a big one.

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                That's good to hear. Good luck with the rest of your project.

                Comment

                Working...