Posted: January 12, 2020 at 5:31 pm
We are testing Event Espresso on a test server (local computer /etc/hosts line item set: 192.163.224.33 locworld.com http://www.locworld.com) before implementing on production server. Page 1. Page 2. We would like to identify the Event ID on Page 2 using jQuery to get information on an AJAX call. It would be nice if there were a hidden field with the event ID, but since there isn’t how can we get the event ID for use in an AJAX call? Browser developer tools and “view page source” shows the event ID many times on the first page. Such as in the body tag: It shows the registration page id on the Attendee Information entry page, but does not show the event ID at all on the Attendee Information entry page. wp_posts: The WordPress event ID is 32852 |
|
Hi there, Whilst it’s possible to add the event ID(s) to the body class mentioned above, I don’t really recommend doing so and you have a better option of pulling the events directly from the users session. Here’s an example of how you can use the ssn to add the event ids to the body class: https://gist.github.com/Pebblo/f4561461339c59411a849f93c91912a9 But again, if you are going to do that for an ajax request, you could just do almost exactly the same on said request and pull the event id’s directly rather than loading them into the page, to find them using jQuery, to pass them to the ajax request to use them. |
|
The support post ‘Get event ID on registration Attendee Information entry page for AJAX’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.