You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2022/01/26 07:32:30 UTC

[GitHub] [sling-org-apache-sling-dynamic-include] jar-miracle commented on pull request #23: SLING-11087: Fix for multiple components being fetched via JSI

jar-miracle commented on pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-dynamic-include/pull/23#issuecomment-1021937338


   Seems `let` is supported by most major browsers since at least 2016: https://caniuse.com/let
   
   Using `var` pollutes the global variable space of the browser. This causes the same component to be inserted multiple times rather than different components. I don't know too much about JavaScript, but I don't see how using `var` along with IIFE would solve this issue.
   
   Another solution could be to append the `xhr` variable with a number similar to how the `div` is appended. We went with the `let` solution at the company where I needed this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org