Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Ajax
Ajax the combination of XHTML, CSS, DOM, XML, XSLT, XMLHttpRequest, and JavaScript
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ajax section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 6th, 2006, 11:25 AM
Registered User
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default AJAX problem - the whole page is reloading

I have a webpage that works with ajax, html and php. No XML

The ajax part works good instead of one thing. The whole page(with the header image and all the html code) is loading again plus the results from my php script into the <div id="jobs"></div>.

a = document.getElementById('jobs');
a.innerHTML = '<div id="jobs"></div>';
a.innerHTML = httpRequest.responseText;

I guess that the problem is in the url.

For example:

I have a form on that page. When I submit the form (with ajax) the url that I post is something like:

this url doesn't appear in the location bar.

So the page loads the result I want AND the whole html code from http://www.mywebsite.com/index.php?id=test again!!!
So I see the webpage 2 times.

Sorry for my english. :(

Please help me!!

Old June 7th, 2006, 01:39 PM
Registered User
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

The solution to that problem is:
I created a new page that contain my code and I included that page to the "http://www.mywebsite.com/index.php?id=test".

So all the process is being in the new page and appear in the "http://www.mywebsite.com/index.php?id=test".

geoko :D

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reloading page with Ctrl+F5 aliirfan84 ASP.NET 2.0 Professional 1 October 10th, 2007 07:19 AM
reloading a page hubbe ASP.NET 1.0 and 1.1 Basics 0 April 13th, 2006 01:46 PM
Reloading page when option selected in dropdown chandrasekhar200 Beginning PHP 1 March 10th, 2006 04:52 AM
Page Reloading mahulda ASP.NET 1.0 and 1.1 Basics 5 April 21st, 2004 10:22 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.