Hijaxing rendered html

4 views
Skip to first unread message

peter_breton

unread,
Oct 27, 2010, 10:02:55 AM10/27/10
to jquery-claypool
Hi,

I am a long-time developer, fairly new to advanced Javascript,
experimenting with Claypool. So far I appreciate its power, but it has
lots of magic and not so much documentation :)

I have a few basic MVCs working, but I am having the following
problem: when I dynamically render a page containing new links,
buttons, etc., these new items are not Hijax'ed. The new content is
essentially HTML with the results of an Ajax query, a new row (with
clickable links, etc) for each returned item.

The dynamic rendering is done using Mustache, not the bundled
jtemplates, but as far as I can tell that shouldn't make a difference.

Is this supposed to work? Do I have to do anything additional?

Best Regards,

Peter

chris thatcher

unread,
Oct 27, 2010, 3:26:31 PM10/27/10
to jquery-...@googlegroups.com
Hi Peter,
yup it should work, with the caveat that the newly rendered dom nodes should be added via jQuery methods like $().append, $().after etc.  This is a side effect of how livequery works.  A recent goal is to refactor Claypool to use jQuery.live which wasnt around when I first wrote the hijax implementation, and the end result would be the loosening of this constraint.

If that doesnt help could you paste your routers and the relevant mustache code? 

Thatcher

PS  I totally understand the docs are starving, I wish I had a little more time but right now I don't.  1.2 release candidates are out and I hope to rebuild a substantial part of the website soon to allow wiki editing of the documentation.  If you have any interest in helping to sustain and promote claypool at some point in the future please let me know, I sure could use the help.

Thatcher


--
You received this message because you are subscribed to the Google Groups "jquery-claypool" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to jquery-claypo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jquery-claypool?hl=en.




--
Christopher Thatcher

peter_breton

unread,
Oct 27, 2010, 3:55:21 PM10/27/10
to jquery-claypool
Thanks!

Using $().append works... before I was using $().html, which did not.

Best,

Peter

> Hi Peter,
> yup it should work, with the caveat that the newly rendered dom nodes should
> be added via jQuery methods like $().append, $().after etc.  This is a side
> effect of how livequery works.  A recent goal is to refactor Claypool to use
> jQuery.live which wasnt around when I first wrote the hijax implementation,
> and the end result would be the loosening of this constraint.
>
> If that doesnt help could you paste your routers and the relevant mustache
> code?
>
> Thatcher
>
> PS  I totally understand the docs are starving, I wish I had a little more
> time but right now I don't.  1.2 release candidates are out and I hope to
> rebuild a substantial part of the website soon to allow wiki editing of the
> documentation.  If you have any interest in helping to sustain and promote
> claypool at some point in the future please let me know, I sure could use
> the help.
>
> Thatcher
>
> On Wed, Oct 27, 2010 at 10:02 AM, peter_breton <peter_bre...@yahoo.com>wrote:
>
>
>
>
>
> > Hi,
>
> > I am a long-time developer, fairly new to advanced Javascript,
> > experimenting with Claypool. So far I appreciate its power, but it has
> > lots of magic and not so much documentation :)
>
> > I have a few basic MVCs working, but I am having the following
> > problem: when I dynamically render a page containing new links,
> > buttons, etc., these new items are not Hijax'ed. The new content is
> > essentially HTML with the results of an Ajax query, a new row (with
> > clickable links, etc) for each returned item.
>
> > The dynamic rendering is done using Mustache, not the bundled
> > jtemplates, but as far as I can tell that shouldn't make a difference.
>
> > Is this supposed to work? Do I have to do anything additional?
>
> > Best Regards,
>
> > Peter
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "jquery-claypool" group.
> > To post to this group, send email to jquery-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > jquery-claypo...@googlegroups.com<jquery-claypool%2Bunsubscribe@ googlegroups.com>
> > .

chris thatcher

unread,
Oct 27, 2010, 7:58:59 PM10/27/10
to jquery-...@googlegroups.com
hmm, $().html  should have worked since it uses $().append internally.  What version of jquery are you using?  And just out of curiosity can you paste the couple lines of code you use to render with mustache.js?

glad it got you past that though.

Thatcher

To unsubscribe from this group, send email to jquery-claypo...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/jquery-claypool?hl=en.




--
Christopher Thatcher
Reply all
Reply to author
Forward
0 new messages