Jump to content


Photo

iframe question


  • Please log in to reply
1 reply to this topic

#1 nabeelkhan

nabeelkhan
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 29 May 2006 - 02:17 PM

I have written this following code snippet somewhere in my code...

<iframe id="abc" name="abc" height="100%" width="100%" src="view.php?mode=view&id=<?=$_GET['id']?>"> </iframe>


in Internet Explorer it behaves exactly as it should. i.e displays the page view.php in teh iframe...

But in Mozilla it displays an empty iframe written in it this code..

<script language='javascript'>
            location.href = 'editor.php?id=2&category=2'
            </script><P>asdas</P>
<P>asdas</P>
<P>asd</P>
<P>.</P>

how to solve it...

#2 Ferenc

Ferenc
  • Members
  • PipPipPip
  • Advanced Member
  • 94 posts

Posted 30 May 2006 - 12:16 AM



<iframe src="iframe_page1.html"
id="testiframe"
name="testiframe"></iframe>

Most browsers need the name attribute to make the iframe part of the frame hierarchy. Some browsers (notably Mozilla) need the id to make the iframe accessible as an object. By assigning both attributes to the iframe you keep your options open. But name is far more important than id.
Everything you want to know is here.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users