I have an embedded template with some javascript that modifies it before it gets included.
The template is called repeatedly within a loop where the template content becomes inserted into the main document. However, the Javascript associated with the embedded template only runs the first time.
I am thinking that ee reuses the embedded template without “reopening” it. Therefore the second time around, ee2’s reuse of the template fails to trigger (document).ready. One of the advantages of embedded templates are after all to reduce duplication. However, I would like the js run each time the template is invoked.
I seem to remember something about an additional parameter random that was used with css to ensure reloads, but I am not sure this was the same issue and the discussion was associated with css files and not js.
One post suggests this could be a Javascript issue, but does not elaborate. It seems to me to be related to how the embedding of a template nomrally works in EE. If so I’d appreciate a pointer to where to look for the solution.