Better way to display contnent ? ( curently using iframe )

perez0r

New Member
Hi friends,

I'm curently in a small predicament I built my website in the classical way , banner , menu , contnent. The thing is , in order to display my contnent I use an iframe and anchor butoons to link the pages of my site to it.
code:

<div id="menu">
<a href="home.html" target="testframe">HOME</a> <br />
<a href="aboutus.html" target="testframe">ABOUT US</a> <br />

</div>


<div id="contnent">

<iframe src="home.html" name="testframe" scrolling="no" width="680" height="600"></iframe>


</div>


I recently learned that iframes are not good to use to display contnent and they slow down the website.

My questions is , would another div be better to display my contnent ? if yes please tell me how can i link a external page to my <div> and also if you have other better ways to display contnent of the website please share them with me.

Best regards,
Alex
 

CaldwellYSR

Member
I'm 99% sure you can't show external pages to a div. That's what iFrames are for. Why do you want to get rid of the iframe?
 

perez0r

New Member
I'm 99% sure you can't show external pages to a div. That's what iFrames are for. Why do you want to get rid of the iframe?

well another forums people are saying iframe is old and obsolete and also slows down a website , anyway i found a solution to my problem with jquery and ajax

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("div").load('test1.txt');
});
});
</script>
</head>
<body>

<div><h2>Let AJAX change this text</h2></div>
<button>Change Content</button>

</body>
</html>

courtesy to w3schools

i will addapt this code to my website. if you know other ways to display contnent to website please share with me.

thank you
 
Top