Almost there...
I've posted a working example at
http://www.friendpaste.com/2Wu3Ys1umMxZ95wnLpgoxP
On Jul 8, 6:25 pm, Todd Gruben <
tgru...@gmail.com> wrote:
> so if it doesn't work then there is a bug?
>
> Currently with this modified with the div code, I only see one copy of the
> Timestamp
>
> -todd
>
>
>
> On Wed, Jul 8, 2009 at 11:04 AM, Mic Cvilic <
tch...@gmail.com> wrote:
> > ToddG wrote:
>
> > if that is true, why don't i see 2 copies of the output in this
> > example?
> >
http://www.friendpaste.com/2Wu3Ys1umMxZ95wnLpgoxP
>
> > Place "div#extra" before the script tag and it should be ok.
>
> > I think this is the last hurdle i have to conquer.
>
> > -Todd
>
> > On Jul 6, 2:02 pm, Mic Cvilic <
tch...@gmail.com> <
tch...@gmail.com> wrote:
>
> > Todd Gruben wrote:
>
> > Awesome. That is perfect. Thanks for you help.
>
> > Would it be difficult to use the same clock template, compiled once,
> > and rendered in 2 different destination divs? From this example
> > perhaps displaying 2 timezones?
>
> > You can call multiple times the "template" function that you get from
> > the html.compile(...) call.
> > And passing as a parameter the data you want to render.
>
> > div1.innerHTML = template(data1);
> > ...
> > div2.innerHTML = template(data2);
>
> > The example would be useful to me in describing template reuse.
>
> > I am really starting to like your tool.
>
> > I hope so, with all these efforts ;)
>
> > I am new to both javascript and jquery so there is a bit of learning
> > curve.
>
> > -Todd
>
> > On Jul 5, 2:45 pm, ToddG <
tgru...@gmail.com> <
tgru...@gmail.com> <mailto:
tgru...@gmail.com> <
tgru...@gmail.com> wrote:
>
> > I am trying to solve the same problem. I have a polling ajax loop
> > that is updating a status area which is hopefully going to be a pure
> > template. it works fine for the first try but after that it seems
> > that the div has gone away. I really want to use the compile / render
> > option. Could anyone provide an example that simply compiles a
> > template then goes into a loop and renders the template perhaps with a
> > counter or something. I am so close, just need a little kick.
>
> > A trival example would be something that downloads the current time
> > once a second. Basically i am having issues replacing the html in
> > the destination div the second time.
> > -
>
> > -Todd
>
> > On Jul 2, 4:33 am, Mic Cvilic <
tch...@gmail.com> <
tch...@gmail.com> <mailto:
tch...@gmail.com> <
tch...@gmail.com> wrote:
>
> > ussmoss wrote:
>
> > Thanks for the quick response. Just to make sure I understand
> > correctly, I would save the HTML to JS variable and then swap out the
> > DOM element that I am using for the template and call the render
> > function. If I do the compile option just makes the process faster, I
> > still need to replace the DOM element with the template skeleton.
>
> > One last quesiton would it be possible to give the steps on how to
> > compile and save out on the templates. I was trying to go over the
> > examples but since I am new to this I am not quite sure that I see how
> > to do that. Thanks again for the help and making such a great template
> > engine in JS>
>
> > Have a look at:
http://wiki.github.com/pure/pure/optimize-your-response-time
> > The optimisation1 paragraph.
>
> > In the coming release things are changing about compile. You can read as
> > well:
http://wiki.github.com/pure/pure/pure-version-2-release-notes
> > Look for the $p.compile paragrap
>