I am might be going about this in the wrong way but I wanted to get confirmation.
I have a comet lift snippet that waits for a comet actor to send down search results triggered by a button click after entering keywords. <lift:comet type="SearchActor"> <Search:SearchResults>Loading...</ Search:SearchResults> </lift:comet> In the actor I rendor the search results and merge an onclick function into the header document.ready. Things seem to work fine but after the snippet renders the onclick function does not activate until I click on 2 hyperlinks, which takes me to the linked website (click url) then hitting the back button back to the liftwebsite, basically reloading the page twice. After this the alert box shows up for each hyperlink. I can refactor this to work in a different way but I wanted to understand what is wrong here if anyone knows. Thanks in advance def render = { def searchResultFormatter(itemToFormat: SearchResultSet): NodeSeq = { <tr> <td> <a href={itemToFormat.resultSetItem.clickUrl} class="searchlink"> {itemToFormat.resultSetItem.title}</a> </td> </tr> <tr> <td>{itemToFormat.resultSetItem.summary}</td> </tr> } bind("SearchResults" -> <table>{searchLinks.flatMap (resultFormatter _)}</table> <head> <script type="text/javascript" charset="utf-8">{Unparsed (""" jQuery(document).ready(function() { $('.searchlink').click(function() { alert('call made it here'); return (false); }); }) """)}</script> </head>) } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---