Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Other Scripting Languages (http://www.programmingforums.org/forum39.html)
-   -   How to make common navigation not reload. (http://www.programmingforums.org/showthread.php?t=7902)

Sungam Jan 10th, 2006 5:19 PM

How to make common navigation not reload.
 
I don't know a lot about Server Side scripting, or using C/perl in CGI as opposed to using PHP or ASP for this kind of thing. Which one should I learn, to make the navigation not have to reload when you click on a link to go to a different section of the website?

Sungam Jan 11th, 2006 7:33 PM

I hope that you guys aren't intimidated by my question. I don't want you to tell me exactly how to do this, I just need someone to help point me in the right direction.

Sane Jan 11th, 2006 7:55 PM

Oh I know what you mean. Like those sites where it's a stationary template, and then the content inside the middle section is the only part that loads when you click a link.

I don't know how to do this, but I suppose it is something to do with cgi or excrutiating javascript. Most people don't worry about those kind of layouts though, since it doesn't really change anything perhaps the feasability of making quick changes.

Sorry I couldn't be of much help. =\

Jessehk Jan 11th, 2006 8:04 PM

Now, this is a complete guess, because I have done very, very limited html.
I believe that when using frames, one part of the site can update, while another stays the same.

Sungam Jan 11th, 2006 8:43 PM

yeah, that is the easy way, to use frames. But then all sorts of things go wrong when you try to print, bookmark a page, or if you want to exit the frameset.

coldDeath Jan 12th, 2006 1:43 AM

Most sites use evil frames for that. I'm sure there are some other ways around it though.

Arevos Jan 12th, 2006 2:56 AM

PHP is easy enough to include common files:
[php]<?php include "yourfile.html"; ?>[/php]Just place that tag in your html files. Rename them to .php, and that tag will be replaced with the file you want to include (assuming your server supports PHP).

Polyphemus_ Jan 12th, 2006 7:59 AM

Frames were used in the time Internet and computers were slow... a browser had only to load a part of the page, instead of the whole page. Today, using frames is considered as a bad havit. With PHP, you can dump the navigation, header etc., and place the content code in the actual file. It will be something like this then:

header.php:
:

<html>
<head><title> ... etc (Place header + the navigation over here)

<?php
function footer() {
?>
(Place code for the footer over here)
</body>
</html>
<?php
}
?>


some_page.php:
:

<?php
include("header.php")
?>

Content over here

<?php
footer();
?>


Ooble Jan 12th, 2006 2:20 PM

If you want to only reload part of the page, like in Google's Gmail, Maps, etc. you should check out AJAX. It stands for Asynchronous JavaScript And XML, and is used to download data silently and refresh only the part of the page that needs changing - exactly what you want. As a plus, it also means you can offload a lot of the processing onto the client. It does mean they need JavaScript enabled though, and many people don't for security reasons.

Sungam Jan 12th, 2006 5:32 PM

Thanks for the suggestion, but I think I am going to be looking to more server side ways, because I don't want my website to me relianent upon the clients computer. Google has an advanage because it is offering something that people will really want to use, rather than my personal website, which will be promoting me as a composer.

I knew PHP would work, but it seems like it is just doing something more complex for me behind the curtian so to speak. I would like to do it myself, if that is the case. I was assumming some kind of python or C scripting could do this as well.


All times are GMT -5. The time now is 4:51 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC