Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

add to iframe the javascript of the parent

I have created an html page with an iframe

The content of the iframe is a code which has a table like this (without HTML and BODY tags):

        <td><a href="javascript:go()">go</a>

Javascript fuction called go is defined in the html page which has the iframe

When I display the html and I click on the link, a javascript error appear.
I know that adding the javascript code to the iframe I can resolve this, but my question is:
Can I pass the javascript of the parent html to the iframe without add it to the iframe?


  • 2
1 Solution
Just use :
<a href="javascript:top.go()">go</a>

or :
<a href="javascript:parent.go()">go</a>

Why is it a B are you missing any info ?

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now