Click to See Complete Forum and Search --> : Problem with Bulletproof Ajax(book) Example


willyp
06-30-2007, 11:12 AM
Hello,

I really enjoyed Jeremy Keith's BulletProof Ajax book, and I have a question about the example he uses for Chapter 4 on using html as a data format to load into a page example here:

http://bulletproofajax.com/code/chapter04/html/people/index.html

It works fine on intial load, but then if you
change the one of the html files (after they have been loaded into the browser once) the content does not change after its been
loaded into the browser. (FF mac)

It is using the innerHTML method of inserting the html onto the page.

So, I have tried using this with my own content and the same thing happens.

The first time it loads it works fine, but then when I edit one of the html files that is called by the AJAX call, I still get the old content. It is as if it is not refreshing the data that was loaded to the browser originally.

Do I need to remove the node that is there before trying to reload new data in?

Thanks,
Willy

Kor
07-01-2007, 01:01 AM
It works fine on intial load, but then if you
change the one of the html files (after they have been loaded into the browser once) the content does not change after its been
loaded into the browser. (FF mac)


The request object is "valid" only if there is a server interrogation to be made. When you copy all the files and try to test the AJAX locally, it woun't work (as your PC is not configurated as a server), unless you install and start (using some special applications, like Apache) a "local" server.

willyp
07-01-2007, 10:08 AM
I am running a local server. (I wish that was the simply the problem) I am using firefox with firebug and I can see that the GET function is working and successfully getting the requested file from the server, it just seems to be giving me the same html file as the first time it loaded. Actually, when i run it in Safari, it does refresh the page. Could it have something to do with Cache?

thanks,
willyp

willyp
07-01-2007, 10:19 AM
Well,
I found this script which is a little more extensive and deals withe cache is some way it seems and does work the way I need and hopefully this is the answer to my problem.

http://www.dhtmlgoodies.com/index.html?whichTutorial=ajax-basics

If there are any AJAX experts out there, can you please point me in the right direction to learn more about GET and POST and the cache and loading dynamic content?

-Willy

Kor
07-01-2007, 10:21 AM
Oh, sorry, I have no Mac (nor Safari) to test on... I hope you could find an answer from the Mac users...

willyp
07-02-2007, 01:14 AM
Well, I changed GET to POST, and now I get all of the content and when I change the html it actually reloads it from the server instead of showing me the same content that was cached originally.