You are here: Re: How to access variables in an iframe?(Opera,JavaScript) « HTML « IT news, forums, messages
Re: How to access variables in an iframe?(Opera,JavaScript)

Posted by BootNic on 08/10/07 13:56

cx <cxcxcxcx@gmail.com> wrote:
news:1186749066.388605.324550@i13g2000prf.googlegroups.com:

> I want to acess a variable in the iframe, the following code runs well
> in Firefox and IE, but fails in Opera. Can I modify the code to meet
> opera's standard?
>
> a.htm:
> <iframe id=q src="b.htm"></iframe>
> <script>
> var i;
> var l=document.getElementById('q');
> alert(l.kkk);
> </script>
>
> b.htm:
> <script>
> var kkk=1;
> </script>

<script type="text/javascript">
var l=document.getElementById('q');
l.onload=function(){alert(l.contentWindow.kkk)}
</script>

--
BootNic Friday, August 10, 2007 9:56 AM

I had a monumental idea this morning, but I didn't like it.
*Samuel Goldwyn*

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация