Thanks for your email. Still could not get it to work. I probably
do not understand well how this thing (jquery/turbogear/cache)
supposed to work. I will dig into it further, any additional
suggestion is greatly appreciated. -tpn
My answers to your questions:
======================
(1) There is no particular reason to use local import, I need to clean up that.
(2) The call (load) works fine, as shown in the output, but the
replacement of "timetest" does not happen when "get time" is clicked.
I also modified the code to add a random number to the query such as
load("/time?sid=" + Math.random())... but does not help though.
Below are the sample code and the output (btw, I tried this on both
Firefox and IE, no difference). Also I did not see any difference
between using $('timetest') versus $('#timetest')
template:
$('#timetest').load("/time?sid=" + Math.random())
});
});
</script>
</head>
<body>
<div id="timelink"><a href = "#">get time</a></div>
<div id="timetest" py:replace="now"></div>
</body>
</html>
Controller (root.py)
==============
@expose('helloworld.templates.about')
def about(self, **kw):
jquery_js.inject()
return dict(now=time.ctime())
@expose()
def time(self, sid):
print "time is called ...sid=%s" % sid
return dict(now=time.ctime())
Output (server console):
=================
serving on
0.0.0.0:8080 view at
http://127.0.0.1:8080
time is called ...sid=0.7600414370879561
time is called ...sid=0.08766271084959143
time is called ...sid=0.9154010756223916
time is called ...sid=0.13931412162353551
time is called ...sid=0.9629765981657245
time is called ...sid=0.19117089588204772
time is called ...sid=0.6440978896256766
time is called ...sid=0.550432448440006
time is called ...sid=0.9023927250869724
time is called ...sid=0.1985474145942756
time is called ...sid=0.14242761973297957
time is called ...sid=0.5346612822522109
time is called ...sid=0.6367426755820135
tpn
> For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.
>
>
>