/    Sign up×
Community /Pin to ProfileBookmark

Problem with Bulletproof Ajax(book) Example

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:

[URL=”http://bulletproofajax.com/code/chapter04/html/people/index.html”]http://bulletproofajax.com/code/chapter04/html/people/index.html[/URL]

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

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@KorJul 01.2007 — 

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)
[/QUOTE]


The request object is "valid" only if there is a [I]server[/I] 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.
Copy linkTweet thisAlerts:
@willypauthorJul 01.2007 — 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
Copy linkTweet thisAlerts:
@willypauthorJul 01.2007 — 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
Copy linkTweet thisAlerts:
@KorJul 01.2007 — Oh, sorry, I have no Mac (nor Safari) to test on... I hope you could find an answer from the Mac users...
Copy linkTweet thisAlerts:
@willypauthorJul 02.2007 — 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.
×

Success!

Help @willyp spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...