Changing the content of a div tag help required
-
Hello, I am using a div tag in a page called profiles.php whos left content is being brought in by using require_once...
<div class="divMain_Left">
<?php require_once('left.php'); ?>
</div>whilst this works fine and I have links in the page left.php that is being fed in to the div, I would like when any of these links are clicked to have it open in the same div tag? I have tried the target options but none of them seem to open within the div tag and they just open a new page. If anybody could point me in the right direction please. Many thanks in advance Regards Ray
-
Hello, I am using a div tag in a page called profiles.php whos left content is being brought in by using require_once...
<div class="divMain_Left">
<?php require_once('left.php'); ?>
</div>whilst this works fine and I have links in the page left.php that is being fed in to the div, I would like when any of these links are clicked to have it open in the same div tag? I have tried the target options but none of them seem to open within the div tag and they just open a new page. If anybody could point me in the right direction please. Many thanks in advance Regards Ray
-
Hello, I am using a div tag in a page called profiles.php whos left content is being brought in by using require_once...
<div class="divMain_Left">
<?php require_once('left.php'); ?>
</div>whilst this works fine and I have links in the page left.php that is being fed in to the div, I would like when any of these links are clicked to have it open in the same div tag? I have tried the target options but none of them seem to open within the div tag and they just open a new page. If anybody could point me in the right direction please. Many thanks in advance Regards Ray
What you're trying to do can't be done by inlining the included content with include() or require(). The content that you wish to include will require an additional request to the server for the new content and this will need to be rendered to be browser either using AJAX or an iframe. AJAX would be generally accepted to be the best practice in this case. This is somewhat advanced stuff, but the jQuery library would make this relatively easy. You would assign a function to the onclick event of the link that would "get" the content from the content URL. For more information, see: http://www.w3schools.com/htmldom/default.asp[^] http://api.jquery.com/jQuery.get/[^]