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

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

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

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?

Regards

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

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






0
 
avnerCommented:
Why is it a B are you missing any info ?
0

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