Div Wrappers

Status
Not open for further replies.

JasonCairns

Active Member
212
2010
25
0
I'm just wondering if anyone can explain how to use a Div to load page content like an iframe does.

For example:
Code:
<div id="content">

<a href="http://google.com">This link will be shown inside my content box</a>

</div>

I don't want to use iframes to load pages.
 
6 comments
you can use jquery to load the contents on a file to a div , but it wont support cross domain requests


PHP:
<!DOCTYPE html>
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script type="text/javascript">
$("#wjunction").load("wj.php");
  </script>
</head>
<body>
<div id="wjunction"></div>
</body>
</html>
wj.php can be a simple php script which opens the contents of the site needed..
use fopen or curl , remember wj.php or any file for that matter handled by ajax has to be on the same server .
 
ok..It will work to display the contents of any website/ page ( so if you edit the page , it will load the contents of that page to this div ) , into a div..
your question has to be more specific to get exact answers .. :)

edit : looks like you want to implement tabs system ?
 
Status
Not open for further replies.
Back
Top