AHHHHH! I just verified the problem is caching. If I replace with..
var d = loadJSONDoc('http://seberino.org/chat/test?timestamp=' + new
Date().getTime());
Then the darn thing gets called everytime avoiding the cache.
Is this a common problem with AJAX? Caching seems like it would
get in the way often. Imagine if you wanted to poll. You can't let
cache stop you from polling!?!?!
Chris
On Jan 8, 11:54 pm, "Kevin Horn" <[EMAIL PROTECTED]> wrote:
> Hmmm, well, the controller seems to work fine, as I get a nice piece of JSON
> in my web browser when I hit that URL. So the problem is definitely in your
> javascript. I worked a lot with loadJSONDoc on a project about a year ago.
> I'll try and find the code.
>
> Tomorrow though. It's way too late... :(
>
> Kevin Horn
>
> On Jan 9, 2008 1:10 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > I created a tiny TurboGears app with a single button
> > that invokes a Javascript function to change the text of a
> > paragraph.
>
> > You can see for yourself by using app athttp://seberino.org/chat.
> > You can even see all source code athttp://seberino.org/tiny.
>
> > I tried to bolt onto the this little Javascript function a
> > loadJSONDoc MochiKit call that never seems to
> > work and I don't know why.
>
> > Here is all the Javascript code for this function...
>
> > ======================================
> > var editItem = function() {
> > var item = document.getElementById("test_paragraph");
> > item.innerHTML = "This is the new text after JS function called.";
> > var d =
> > loadJSONDoc('http://seberino.org/chat/test'<http://seberino.org/chat/test%27>
> > );
> > d.addCallback(doNothing);
> > }
>
> > var doNothing = function(obj) {
> > return true;
> > }
> > ======================================
>
> > The way I know if loadJSONDoc was successful is that
> > I created a counter athttp://seberino.org/chat/test
> > that gets incremented whenever accessed/reloaded.
> > I never see the counter increment when I invoke that
> > Javascript function.
>
> > WHY???
>
> > Any help greatly appreciated.
>
> > Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---