Solved

Using IFrame

Posted on 2000-03-07
12
146 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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

Industry Leaders: 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!

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

696 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