Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > A Challenge: Call parent Javascript function from inside an iframe?

Reply
Thread Tools

A Challenge: Call parent Javascript function from inside an iframe?

 
 
Chris Ianson
Guest
Posts: n/a
 
      04-05-2006
Hi geniuses (or is that genii, or genies)

The challenge is as above really. I have a page with an iframe in it, and
need to call a JS function in the *parent* page, *from* inside the iframe.

(It's for Google Maps, but I won't bore you with the complexities of that,
as it doesn't affect the question).

Mochas kudos to anyone able to solve this widdle.

Ta.


 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      04-05-2006
Chris Ianson wrote:
> Hi geniuses (or is that genii, or genies)
>
> The challenge is as above really. I have a page with an iframe in it, and
> need to call a JS function in the *parent* page, *from* inside the iframe.
>
> (It's for Google Maps, but I won't bore you with the complexities of that,
> as it doesn't affect the question).
>
> Mochas kudos to anyone able to solve this widdle.


Still flogging the iframe 'dead horse' I see.

parent.yourfunction();


Don't try patenting it though...


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
 
Chris Ianson
Guest
Posts: n/a
 
      04-05-2006
"Jonathan N. Little" <(E-Mail Removed)> wrote in message
news:443336ae$0$3697$(E-Mail Removed).. .

> Still flogging the iframe 'dead horse' I see.


By 'dead horse' I assume you mean 'now working perfectly in all
browsers'.

> parent.yourfunction();


Sadly this doesn't seem to work for Google Maps API. Are there any other
methods to call JS from the parent frame?

> Don't try patenting it though...


Too right, I have enough of them already...

TIA


 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      04-05-2006
Chris Ianson wrote:
> "Jonathan N. Little" <(E-Mail Removed)> wrote in message
> news:443336ae$0$3697$(E-Mail Removed).. .
>
>> Still flogging the iframe 'dead horse' I see.

>
> By 'dead horse' I assume you mean 'now working perfectly in all
> browsers'.
>
>> parent.yourfunction();

>
> Sadly this doesn't seem to work for Google Maps API. Are there any other
> methods to call JS from the parent frame?



http://www.google.com/apis/maps/documentation/
Google Maps API Documentation
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Chris Ianson
Guest
Posts: n/a
 
      04-05-2006
"Jonathan N. Little" <(E-Mail Removed)> wrote in message
news:4433f73b$0$3681$(E-Mail Removed).. .

> http://www.google.com/apis/maps/documentation/
> Google Maps API Documentation


Yes, I am far too familiar with that URL having used it for the past few
weeks.

The question I have asked is not covered therein.

If anyone is able to provide an answer that would be great.

TIA.


 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      04-05-2006
Chris Ianson wrote:
> "Jonathan N. Little" <(E-Mail Removed)> wrote in message
> news:4433f73b$0$3681$(E-Mail Removed).. .
>
>> http://www.google.com/apis/maps/documentation/
>> Google Maps API Documentation

>
> Yes, I am far too familiar with that URL having used it for the past few
> weeks.
>
> The question I have asked is not covered therein.
>
> If anyone is able to provide an answer that would be great.


Sorry this IS how you reference a function in the parent frame. If it
does not work for you then you must be and error of how you are using
the function. Without URL only speculation.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Chris Ianson
Guest
Posts: n/a
 
      04-05-2006
"Jonathan N. Little" <(E-Mail Removed)> wrote in message
news:443406c6$0$3703$(E-Mail Removed).. .

> Sorry this IS how you reference a function in the parent frame. If it does
> not work for you then you must be and error of how you are using the
> function. Without URL only speculation.


Are you familiar with Google Maps API Jonathan? I have been working with an
expert in the field and neither of us can get it to work. If you are more
of an expert with the API then we can talk further.


 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      04-06-2006
Chris Ianson wrote:
> "Jonathan N. Little" <(E-Mail Removed)> wrote in message
> news:443406c6$0$3703$(E-Mail Removed).. .
>
>> Sorry this IS how you reference a function in the parent frame. If it does
>> not work for you then you must be and error of how you are using the
>> function. Without URL only speculation.

>
> Are you familiar with Google Maps API Jonathan? I have been working with an
> expert in the field and neither of us can get it to work. If you are more
> of an expert with the API then we can talk further.
>
>

I am familiar with web design, and JavaScript. That is how you reference
a JavaScript function in a non-named parent frame.

No Details
No URL
No Code.

What do you want?

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Marcello
Guest
Posts: n/a
 
      04-06-2006
Hi guys,

sorry to break the 'this works - no this doesn't work' quarrel, but
Chris, have you tried something different?

I've never used Google Maps API, so I don't know if you have access to
code on the parent window. If you do, put a function over there that
access the Google Maps one, and your function in the IFrame then access
your function in the parent frame.

If that still doesn't work, try putting and invisible FRAME (not
IFrame) in the parent window to do the same 'proxy function' approach.
I had to do it once, in another problem. For some reason it was not
working from parent to child <-> child to parent frames, but taking
this proxy function approach solved the problem.

Also, are you passing 'objects' or functions as parameters in this
call?

Thanks,
Marcello

 
Reply With Quote
 
Chris Ianson
Guest
Posts: n/a
 
      04-06-2006
"Jonathan N. Little" <(E-Mail Removed)> wrote in message
news:4434637b$0$3694$(E-Mail Removed).. .

>> Are you familiar with Google Maps API Jonathan? I have been working with
>> an expert in the field and neither of us can get it to work. If you are
>> more of an expert with the API then we can talk further.


Google Maps is a bit of an entity unto itself.

> I am familiar with web design, and JavaScript. That is how you reference a
> JavaScript function in a non-named parent frame.


....only it doesn't work with Google so...

> What do you want?


....my question was a simple one which I will repeat for you as you are
asking what I want:
"Are there any other
methods to call JS from the parent frame?"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Challenge: Call parent Javascript function from inside an iframe? Chris Ianson HTML 22 08-13-2012 11:53 PM
call a parent javascript function inside from an iframe omprakash Java 0 07-30-2012 06:39 AM
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
Confusion over calling a nested function inside a parent function Pyenos Python 5 12-23-2006 01:46 PM
call a parent javascript function from the child window Filiz Duman Javascript 1 01-21-2004 03:30 PM



Advertisments