Solved

Using IFrame

Posted on 2000-03-07
12
144 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to count in a table in php 22 36
HTML &#0153 2 18
Border and image sizing 5 19
tiny glitch in my main slider 3 24
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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 a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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)

809 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