You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have a use case where I need to provide variables, specifically URLs generated using the url tag with arguments, to a component's JavaScript code for AJAX requests.
I came across #744 on how to provide data to HTML templates and also read #622, but the later left me more confused. Additionally, I found an interesting blog post on safely passing data to JavaScript in Django templates. However, I still don’t understand the best way to provide variables to a component's JavaScript code with this package.
While I understand that I could embed the variables in HTML (e.g., using data-* attributes) and retrieve them with JavaScript, I am curious if there is a supported or recommended approach within the package's capabilities to achieve this.
Thanks for your help!
The text was updated successfully, but these errors were encountered:
Hi @m-m-moradi, for now I recommend to go with the data-* HTML attributes or similar. Support for this is in the pipeline, I've got the feature working locally, but it still needs polishing, tests, and documentation. Could be still maybe a month away.
Hi,
I have a use case where I need to provide variables, specifically URLs generated using the
url
tag with arguments, to a component's JavaScript code for AJAX requests.I came across #744 on how to provide data to HTML templates and also read #622, but the later left me more confused. Additionally, I found an interesting blog post on safely passing data to JavaScript in Django templates. However, I still don’t understand the best way to provide variables to a component's JavaScript code with this package.
While I understand that I could embed the variables in HTML (e.g., using
data-*
attributes) and retrieve them with JavaScript, I am curious if there is a supported or recommended approach within the package's capabilities to achieve this.Thanks for your help!
The text was updated successfully, but these errors were encountered: