0

I am very new to JavaScript as well as JSP.

I have a JSP page. In that JSP page, I have one text box to enter the URL, submit button and Extract button. I also embedded iframe in that JSP page. When I enter a URL in the text box and press submit button, the page is loaded in the iframe. It's working fine.

Now I would like to run another JavaScript on the loaded iframe (which has a web page) when pressing Extract button. How can I do it? Please help me out in this issue.

2 Answers 2

1

try document.iframes[frameName].document.yourMethod() or document.iframes[frameName].yourMethod()

Sign up to request clarification or add additional context in comments.

Comments

0

i guess you can do something like this in your iframe.

window.top.yourJS_Object.your_iframe_callback();

while yourJS_Object can also be any method as well. it's just an example. and to access the ifram:

window.frames.<frameName>.document.getElementById('result'); i.e.

but it has to be the same domain as far as i know.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.