How do i open a hyperlink in parent page using javascript?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ruchinagaich1
    New Member
    • May 2007
    • 1

    #1

    How do i open a hyperlink in parent page using javascript?

    Please tell me,
    How do i open a hyperlink in parent page using javascript?
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    What do you mean by opening a hyperlink? Do you mean visiting the link? In the same window or opening another one?

    To access the parent page, try:
    Code:
    window.opener
    The links collection will give you the links in a document. If you have given the link an id, it is even easier:
    Code:
    window.opener.document.getElementById(linkid)
    To change the location:
    Code:
    location.href=newurl
    If you still have problems, post your code.

    Comment

    Working...