CodeIgniter Forums

Full Version: how to give "src" link for iframe
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

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

El Forum

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

El Forum

[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

El Forum

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

El Forum

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