Solved

Using IFrame

Posted on 2000-03-07
12
142 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

708 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

15 Experts available now in Live!

Get 1:1 Help Now