parent's url ? how to...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mel

    #1

    parent's url ? how to...

    i have a main page with an iframe inside it

    from iframe's code, i need to know the URL of the parent

    can someone help please

    PS:- How can i get the URL of the main window (i guess _top)

    thanks


  • Erwin Moller

    #2
    Re: parent's url ? how to...

    Mel wrote:
    [color=blue]
    > i have a main page with an iframe inside it
    >
    > from iframe's code, i need to know the URL of the parent
    >
    > can someone help please
    >
    > PS:- How can i get the URL of the main window (i guess _top)
    >
    > thanks[/color]

    Hi,

    did you try parent.window.l ocation ?

    If you need to go up 2 levels: parent.parent.e tc

    if you need to traverse to another frame try:
    parent.frames["someframen ame"].location

    You can also access JS-routines on other pages that way.

    However, there are some securityrestric tions.
    If one of the frames comes from another domain, you will find you cannot
    access what you want.

    Hope this helps.
    Regards,
    Erwin Moller.

    Comment

    Working...