We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LG Polls - AJAX version stuck at loading

Development and Programming

pushloop's avatar
pushloop
422 posts
16 years ago
pushloop's avatar pushloop

Hey

I’ve run into a problem working with LG Polls, the AJAX version, I’ve set it up like below; everything shows up just fine, and also registers the votes. The problem is that when I vote the answers aren’t updated using AJAX, I still need to reload the page for the results to be updated. And yes, I have added the {exp:lg_polls:head} code to the head, and the Ajax is in the right place on the server.

Base template (.polls)

{exp:weblog:entries weblog="lg_polls" show_future_entries="yes" show_expired="yes" dynamic="off"}
  {embed="modules/.polls_poll"
  entry_id="{entry_id}"
  poll_question="{poll_question}"
  entry_date="{entry_date format='%Y-%m-%d'}"
  expiration_date="{expiration_date format='%Y-%m-%d'}"
  ajax_return="modules/.polls_ajax/{entry_id}"
  return=""
  }
{/exp:weblog:entries}

Poll template (.polls_poll)



Ajax template (.polls_ajax)

{exp:weblog:entries
  weblog="lg_polls"
  entry_id="{segment_3}"
  show_future_entries="yes"
  show_expired="yes"
  limit="1"
  rdf="off"
  disable="categories|category_fields|member_data|pagination|trackbacks"
}
  {embed="modules/.polls_poll"
    entry_id="{entry_id}"
    poll_question="{poll_question}"
    entry_date="{entry_date format="%D, %F %d, %Y - %g:%i:%s"}"
    expiration_date="{expiration_date format="%D, %F %d, %Y - %g:%i:%s"}"
    ajax_return="modules/.polls_ajax/{entry_id}"
  }
{/exp:weblog:entries}
       
hothousegraphix's avatar
hothousegraphix
851 posts
15 years ago
hothousegraphix's avatar hothousegraphix

Wondering if you ever solved this issue. I too am experiencing this. I can get the poll to update without ajax involved, but once I include lg_polls.js the poll remains stuck loading after the user submits.

Wondering if you experienced a conflict somewhere or if you found a way to refresh the poll container?

       
pushloop's avatar
pushloop
422 posts
15 years ago
pushloop's avatar pushloop

Hey, I did solve it. Let me just think about what I did… I believe it was because the Ajax template was a hidden template. .polls_ajax has to be polls_ajax.

Good luck!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.