CodeIgniter Forums
how to give "src" link for iframe - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter Archived (from EllisLab) (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: how to give "src" link for iframe (/thread-30971.html)



how to give "src" link for iframe - El Forum - 06-02-2010

[eluser]max123[/eluser]
I want to load a view file inside an iframe. So how can I give the path to "src" property. In codeigniter view has to be loaded through a controller

eg

Code:
<iframe src ="view1.html" width="20%" height="300">
<p>Your browser does not support iframes.</p>
&lt;/iframe&gt;



how to give "src" link for iframe - El Forum - 06-02-2010

[eluser]mddd[/eluser]
The page you load in an iframe is just the same as any other page. So you must put in the full url to that page. Same as when you would make a link to the page using "A HREF".
Off topic: I would not recommend using iframes for loading stuff from your own site. Why would you. There are better ways.


how to give "src" link for iframe - El Forum - 06-02-2010

[eluser]max123[/eluser]
I want to show more records in a small area. Therefor I thought of putting an iframe so that user can scroll down inside the iframe to view all the records.

Please mention if there are other better ways


how to give "src" link for iframe - El Forum - 06-02-2010

[eluser]LuckyFella73[/eluser]
You can set up a div tag and style with css like:
Code:
div.records {
width:200px;
height:200px;
overflow:scroll;
}

If content is higher than div height a scrollbar becomes visible.

Load the records in controller and pass records-data to the view
and echo inside the div-tag.


how to give "src" link for iframe - El Forum - 06-02-2010

[eluser]max123[/eluser]
Thanx a lot dear. It works. May all ur dreams come true