Connecting Tech Pros Worldwide Forums | Help | Site Map

Problem with path between parent and child html pages

Newbie
 
Join Date: Feb 2009
Location: India
Posts: 6
#1: Feb 12 '09
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's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Feb 12 '09

re: Problem with path between parent and child html pages


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!
Newbie
 
Join Date: Feb 2009
Location: India
Posts: 6
#3: Feb 13 '09

re: Problem with path between parent and child html pages


Thanks acorder :)

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

Expand|Select|Wrap|Line Numbers
  1. function helpClicked() {
  2.   this.document.getElementById('leftContent_div').innerHTML = '<'+'object id="homeComp" name="homeComp" type="text/html" data="help_left.html" width="604" height="690"><\/object>';
  3. }
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.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Feb 13 '09

re: Problem with path between parent and child html pages


Why not use an iframe? Any particular reason?
Newbie
 
Join Date: Feb 2009
Location: India
Posts: 6
#5: Feb 21 '09

re: Problem with path between parent and child html pages


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
File Type: zip Default_and_child_htmls.zip (833 Bytes, 2 views)
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#6: Feb 23 '09

re: Problem with path between parent and child html pages


If I change the object to an iframe, it works:
Expand|Select|Wrap|Line Numbers
  1. <iframe id="homeComp" src="child.html" width="400" height="400"></iframe>
Newbie
 
Join Date: Feb 2009
Location: India
Posts: 6
#7: Feb 24 '09

re: Problem with path between parent and child html pages


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.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#8: Feb 24 '09

re: Problem with path between parent and child html pages


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

Tags
parent, parent function, path


Similar JavaScript / Ajax / DHTML bytes