Solved

run function

Posted on 2004-04-15
5
195 Views
Last Modified: 2012-05-04
Hi Experts,

I have JSP page within IFRAME and need to execute Javascript located in main page when some key is pressed. How ?

Thank you.
0
Comment
Question by:fpoyavo
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10835112
With my limited knowledge of javascript.. its seems that its not possible...

is it a inline function or its a function thats written in a .js file and js file is included??
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10835278
The problem is that this is function using elements of the main page. May be You know how to access elements of the main page from IFRAME ?

Thank you.
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10835330
oh yeah thats easy...:-)

parent.document.getElementByid("elementName");

or
ParentFrameName.document.getElemenetById(""elementName");
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10835394
almost correct.. should be top.document.getElementById('elementName').value.
0
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 500 total points
ID: 10835421
top.document.getElementById('elementName').value.
works only if you have one level of framing... if you have a frame and then a frame inside the frame then top might not give the right results.. that why I tried doing it with names... the correct one wd have been...

top.framename.document.getElementById('elementName').value.
btw in java script whatever runs is correct to me....:-)
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now