homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Life without #refresh
How to surf the web site without complete refresh?

5+ Year Member

Msg#: 3856133 posted 9:12 pm on Feb 23, 2009 (gmt 0)

Since I had no luck googleing, I have to ask you guys.

How do I make the web site browsing without complete refresh?

We all use Gmail and Facebook. How can I make those links with anchors like, and refresh only some parts of the page (read from php/mysql):


I use HTML, php and mysql.



Kings on steeds

5+ Year Member

Msg#: 3856133 posted 11:12 pm on Feb 25, 2009 (gmt 0)

Its simple ajax, as your a JS beginner, download Prototype.js from Prototype.org simple include it as a javascript above all your other scripts, it handels all the hard parts of ajax for you, then,

your page would look something like this,

<title>Ajax Test</title>
<script language='javascript' type='text/javascript' src='./Prototype.js'></script>
<div id='ajaxContent' name='ajaxContent'></div>
<a href='./page.php?idx=1' onClick="return ajaxPage(this.href)">Update Page</a>

and your ajaxPage() function would look like this,

function ajaxPage(url){
new Ajax.Updater('ajaxContent', url);
return false;

That is the bace of ajax, if you want to go further and have your ajax function bookmarkable you will need to learn JS as its a long winded effot that requires about 50 browser work arounds. Prototype should get you started.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved