[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

calling jscript function from a page called in iframe - iframe src

Hi,
I am calling a page in iframe. Which I think ultimatly becomes a part of main page? please correct
In either case what I am trying to do is to call a jscript function such as,
function show_popup()
{ document.getElementById('display-frame').style.display = 'none';
   document.getElementById('waiting-div').style.display = 'block';}
these divs are present in the main page so does the iframe - in which I call this page
where onClick of the button I am trying to run the function - show_popup

As you may have judged, I get the error 'object doesn't exist' or 'object requred'
Just wondering if there is way to get over this?

Thanks for your help
0
SameerMirza
Asked:
SameerMirza
  • 3
  • 3
1 Solution
 
wmadrid1Commented:
You can define the function show_popup()  on te ppal window,
and from the iframe page loaded, you can call it:
parent.show_popup();
0
 
SameerMirzaAuthor Commented:
te ppal window?
0
 
wmadrid1Commented:
sorry the confusion
main page
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
wmadrid1Commented:
page1.htm
<script>
function message()
{
alert('Hello');
}
</script>
<iframe src='page2.htm'></iframe>

page2.htm
<a onclick="javascript: parent.message();" href="javascript: void();">
Do click
</a>
0
 
SameerMirzaAuthor Commented:
ok thanks. I am sure it would work
will defiantly allocate the points tomorrow after testing it

Could you also have a look my other thread under the title, 'html display related issue', ID: 26828604
maybe you can advice

Thanks for your help
0
 
SameerMirzaAuthor Commented:
thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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