?
Solved

Using IFrame

Posted on 2000-03-07
12
Medium Priority
?
150 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 800 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

840 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