Solved

Using IFrame

Posted on 2000-03-07
12
143 Views
Last Modified: 2010-04-09
Hi,
I want to create a IFrame tag using DHTML.My Iframe tag will contain clse button,back button,forward button,collapse button and expand button.
I would be glad if anyone help me out.
How can I make this using DHTML?.Any ideas/suggestions will be greatly helpful for me.

Thanks in advance.
0
Comment
Question by:tmmet
  • 7
  • 5
12 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 200 total points
ID: 2595533
Why IFRAME???

<DIV ID ="myDiv"></DIV>
<SCRIPT>
if (document.all) {
   text = "";
   text += '<BUTTON onClick="window.close()">Close</BUTTON>';
   text += '<BUTTON onClick="history.back()">Back</BUTTON>';
   text += '<BUTTON onClick="history.forward()">Forward</BUTTON>';  
   text += '<BUTTON onClick="collapse()">Collapse</BUTTON>';      
   text += '<BUTTON onClick="expand()">Expand</BUTTON>';        
   document.all.myDiv.innerHTML=text;

}
</SCRIPT>


Michel
0
 

Author Comment

by:tmmet
ID: 2596584
Hi,
Thanks for your immediate reply.
I've  to use IFrame as my IFrame contains 2 rows .One for heading and other for contents. Is there any way to split my IFrame into 2 rows?.
Any ides/suggetsions will be grealy helpful for me.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2596713
You mean if I can do this with a DIV?

I am not sure what you mean...

<DIV ID ="myDiv"></DIV>
<SCRIPT>
if (document.all) {
text = "";
text += '<BUTTON onClick="window.close()">Close</BUTTON>';
text += '<BUTTON onClick="history.back()">Back</BUTTON>';
text += '<BUTTON onClick="history.forward()">Forward</BUTTON>';    
text += '<BUTTON onClick="collapse()">Collapse</BUTTON>';      
text += '<BUTTON onClick="expand()">Expand</BUTTON>';          
text += '<HR>'
text += '<%=record%>';
document.all.myDiv.innerHTML=text;
}
</SCRIPT>
0
 

Author Comment

by:tmmet
ID: 2596828
Hi,
Thanks for your reply.I know we can use <DIV> tag  and place buttons in it.How can I embed this <DIV> into my IFrame.I used document.all.myIFrame.innerHTML = ...
I'm getting an error. I want to place this DIV tag(which contains the buttons)into my IFrame.Any ideas/suggetsions will be greatly helpful for me.Thanks in advance.
0
 

Author Comment

by:tmmet
ID: 2596908
Hi,
Thanks for your reply.I know we can use <DIV> tag  and place buttons in it.How can I embed this <DIV> into my IFrame.I used document.all.myIFrame.innerHTML = ...
I'm getting an error. I want to place this DIV tag(which contains the buttons)into my IFrame.Any ideas/suggetsions will be greatly helpful for me.Thanks in advance.
0
 

Author Comment

by:tmmet
ID: 2596978
Hi,
Thanks for your reply.I know we can use <DIV> tag  and place buttons in it.How can I embed this <DIV> into my IFrame.I used document.all.myIFrame.innerHTML = ...
I'm getting an error. I want to place this DIV tag(which contains the buttons)into my IFrame.Any ideas/suggetsions will be greatly helpful for me.Thanks in advance.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2597761
I get the same. Why do you want iframes? for the scrollbars???

Try this:

<IFRAME NAME="if1" SRC="javascript:' '"></IFRAME>
<SCRIPT>
if (document.all) {
   text = "";
   text += '<BUTTON onClick="window.close()">Close</BUTTON>';
   text += '<BUTTON onClick="history.back()">Back</BUTTON>';
   text += '<BUTTON onClick="history.forward()">Forward</BUTTON>';    
   text += '<BUTTON onClick="collapse()">Collapse</BUTTON>';        
   text += '<BUTTON onClick="expand()">Expand</BUTTON>';          
   text += '<HR>'
   text += '<%=record%>';
   with (document.if1.document) {
      open()
      write(text);
      close()
   }
}
</SCRIPT>

Michel
0
 

Author Comment

by:tmmet
ID: 2598505
Hi,
Can you please help me out.I want to create 2 div tags inside my iframe at runtime.Any ideas/suggestions will be greatly helpful for me.Thanks in advance.
0
 

Author Comment

by:tmmet
ID: 2598531
Hi,
Can you please help me out.I want to create 2 div tags inside my iframe at runtime.Any ideas/suggestions will be greatly helpful for me.Thanks in advance.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2600312
<IFRAME NAME="if1" SRC="javascript:' '"></IFRAME>
<SCRIPT>
if (document.all) {
   text = "";
   text += '<DIV>';
   text += '<BUTTON onClick="window.close()">Close</BUTTON>';
   text += '<BUTTON onClick="history.back()">Back</BUTTON>';
   text += '<BUTTON onClick="history.forward()">Forward</BUTTON>';      
   text += '<BUTTON onClick="collapse()">Collapse</BUTTON>';        
   text += '<BUTTON onClick="expand()">Expand</BUTTON>';
   text += '</DIV>';
   text += '<DIV>';
   text += '<%=record%>';
   text += '</DIV>';
   with (document.if1.document) {
      open()
      write(text);
      close()
   }
}
                    </SCRIPT>
0
 

Author Comment

by:tmmet
ID: 2601648
Hi,
Can you please help me out.I want to create 2 div tags inside my iframe at runtime.Any ideas/suggestions will be greatly helpful for me.Thanks in advance.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2601685
Please see the comment!

There are two divs in there

Michel
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

920 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

16 Experts available now in Live!

Get 1:1 Help Now