Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   A Challenge: Call parent Javascript function from inside an iframe? (http://www.velocityreviews.com/forums/t164727-a-challenge-call-parent-javascript-function-from-inside-an-iframe.html)

Chris Ianson 04-05-2006 01:37 AM

A Challenge: Call parent Javascript function from inside an iframe?
 
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.



Jonathan N. Little 04-05-2006 03:17 AM

Re: A Challenge: Call parent Javascript function from inside an iframe?
 
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

Chris Ianson 04-05-2006 12:04 PM

Re: A Challenge: Call parent Javascript function from inside an iframe?
 
"Jonathan N. Little" <lws4art@centralva.net> wrote in message
news:443336ae$0$3697$cb0e7fc6@news.centralva.net.. .

> 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 :)



Jonathan N. Little 04-05-2006 04:59 PM

Re: A Challenge: Call parent Javascript function from inside an iframe?
 
Chris Ianson wrote:
> "Jonathan N. Little" <lws4art@centralva.net> wrote in message
> news:443336ae$0$3697$cb0e7fc6@news.centralva.net.. .
>
>> 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

Chris Ianson 04-05-2006 05:26 PM

Re: A Challenge: Call parent Javascript function from inside an iframe?
 
"Jonathan N. Little" <lws4art@centralva.net> wrote in message
news:4433f73b$0$3681$cb0e7fc6@news.centralva.net.. .

> 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.



Jonathan N. Little 04-05-2006 06:05 PM

Re: A Challenge: Call parent Javascript function from inside an iframe?
 
Chris Ianson wrote:
> "Jonathan N. Little" <lws4art@centralva.net> wrote in message
> news:4433f73b$0$3681$cb0e7fc6@news.centralva.net.. .
>
>> 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

Chris Ianson 04-05-2006 11:39 PM

Re: A Challenge: Call parent Javascript function from inside an iframe?
 
"Jonathan N. Little" <lws4art@centralva.net> wrote in message
news:443406c6$0$3703$cb0e7fc6@news.centralva.net.. .

> 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.



Jonathan N. Little 04-06-2006 12:41 AM

Re: A Challenge: Call parent Javascript function from inside an iframe?
 
Chris Ianson wrote:
> "Jonathan N. Little" <lws4art@centralva.net> wrote in message
> news:443406c6$0$3703$cb0e7fc6@news.centralva.net.. .
>
>> 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

Marcello 04-06-2006 12:43 PM

Re: A Challenge: Call parent Javascript function from inside an iframe?
 
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


Chris Ianson 04-06-2006 02:31 PM

Re: A Challenge: Call parent Javascript function from inside an iframe?
 
"Jonathan N. Little" <lws4art@centralva.net> wrote in message
news:4434637b$0$3694$cb0e7fc6@news.centralva.net.. .

>> 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?"




All times are GMT. The time now is 11:49 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.