In Progress

Ajaxified page, help needed to improve code

I have put together some code from various sources but javascript is somewhat unknown to me and I only seem to fail with the code I have so far..

What I want to do is convert every normal link on the page to ajax links and load the pages through ajax.

So far I only succeeded to transform the links from the initial page and load the content in a div. The problem is I don't have access to the content is loading in the div and the new content still has normal links instead of ajax.

What I need help for is:

The Home page holds the menu and content div.

-I want to convert the new links within the content loaded in the div, every time the div changes.

-Also if the user clicks on the home button in the menu, it will load the content of index along with this script, and everything will become a loop. Find a way to prevent loading the home page in the div, and paste instead a custom text.

-Add a loading gif and animate the load (fast fade)

If you suspect any other problems it may occur from this code can you please advice me what to change?

This is the code I have so far..

Inserted in the head tag:

<script type="text/javascript">

var xmlhttp;

if([login to view URL]) { xmlhttp=new XMLHttpRequest(); }

else if([login to view URL]){ xmlhttp=new ActiveXObject("[login to view URL]"); }

else{ }



{ [login to view URL]("contentarea").innerHTML = [login to view URL]; }

else{ [login to view URL]("contentarea").innerHTML = ""; }


function loadPage(url){

[login to view URL]("contentarea").innerHTML = "";

[login to view URL]("GET",url,true);

[login to view URL](null);



Inserted somewhere in the body:

<div id="contentarea"></div>

Inserted right before the body ends:


var oP = [login to view URL]("a");

var ctr=0;

while(ctr < [login to view URL]){

var oldHref = [login to view URL]("a")[ctr].href;

[login to view URL]("a")[ctr].href="javascript:loadPage('"+oldHref+"');";




Skills: AJAX, jQuery / Prototype

See more: xmlhttp readystate 0, prototype help, problems page, page problem, if xmlhttp.readystate 4, get right code, get prototype, find in page, find help, find animate, fast head, div problems, convert gif to text, loading gif, ctr, convert to ajax, send ajax button, prototype needed script, xmlhttprequest, jquery instead

About the Employer:
( 5 reviews ) Bucharest, Romania

Project ID: #1521994

6 freelancers are bidding on average $46 for this job


Dear sir. I sent you a private message. Please check it. Regards.

$50 USD in 1 day
(56 Reviews)

Ready to do it now. please check your pmb.

$50 USD in 2 days
(23 Reviews)

Hi, I have read your complete statement and I have faced the same problem many weak ago. I can complete this work. Waiting for a positive response. Thank you.

$50 USD in 1 day
(0 Reviews)

please check pmb.

$30 USD in 0 days
(0 Reviews)

Hi, We hav gone through the [login to view URL] can do it.

$45 USD in 1 day
(0 Reviews)

Hi, I am an expert in Jquery, Javascript and ASP .NET.

$50 USD in 5 days
(0 Reviews)