0

On my page, users can click "Show pics", which loads pictures via ajax.

Then, under each picture, you can click "Load associated data" which does another ajax load, attempting to load the new data under the picture.

However, it doesn't work. The second remote request can't find the picture div that was dynamically loaded. It works fine when the picture is not dynamically loaded. Any hints on accessing dynamically loaded content with subsequent ajax requests?

This is equivalent to the problem of first loading dynamic data, and then accessing it in subsequent javascript calls (outside of the success callback method from the initial call), which I have not found a solution to.

bevanb
  • 8,201
  • 10
  • 53
  • 90
  • you should post some code. – jvnill Sep 25 '14 at 07:12
  • @jvn I was afraid that would dissuade viewers as its a lot of code. I don't think the issue is with the code, since it works fine when the picture is not dynamically loaded. I think this is the general problem of "reloading the dom" after an ajax call. – bevanb Sep 25 '14 at 07:18
  • Take a look here, maybe it will help you - http://stackoverflow.com/questions/16613939/rails-cannot-submit-a-remote-form-that-was-loaded-via-ajax – vladCovaliov Sep 25 '14 at 07:19
  • you don't have to include all the code. only parts that are relevant. remove the parts that generate the dom. include details when/what code is ran initially, what gets called, etc. it's hard to help you technically without something technical to work on. your question, in its current state, doesn't conform to SO standards. – jvnill Sep 25 '14 at 07:26

0 Answers0