0

I am developing client side of web application. In this application, there are tons of tabs, divisions, and other html elements. I would like to separate those elements as classified file like tab1_elements.html, tab2_elements.html and want to include those to main page.

sample code

<html>
<body>
<div id="upper_area">
    <iframe src="./right_content.html"></iframe>
    <iframe src="./ceneter_content.html"></iframe>
    <iframe src="./left_content.html"></iframe>
</div>
<div id="main_area">
    <iframe src="./main_content.html"></iframe>
    ...
    ...
</div>

...
...

I googled a bit and noticed that html5 import attribute is just what I am looking for. However, I believe that attribute still not available yet for most browsers.

And I know it will take time to brwosers adapt that attribute. (maybe not adapt at all in worst case). So I am considering including iframe to main page. From what I heard, iframe was almost deprecated by w3c for security reasons and other issues. I wonder what are cons of iframe element and why developers tend to avoid this tag.

Is using iframe a bad idea?

I already tried ajax way to load external html files but chrome browser does not allow ajax communication for local files (application should run ok in off line mode). Can you guys suggest any alternative solutions?

Thank you for reading my post.

tokyovariable
  • 1,656
  • 15
  • 23
Seho Lee
  • 4,048
  • 9
  • 32
  • 42

2 Answers2

0

If you use div instead of iframe it will get same time to render page ! I recommend you this:
<div id="right_content"> </div>
<div id="center_content"> </div> ....etc

and css:
#center_content, right_content, (and other divs)
{overflow:scroll}

Rahiil
  • 110
  • 1
  • 11
-1

Its realy bad practice, use Div, CSS and jquery instead.

Zeeshan
  • 48
  • 1
  • 8