Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any suggestion about asp-fallback-test? #5260

Closed
chucklu opened this issue Sep 22, 2021 · 2 comments
Closed

Any suggestion about asp-fallback-test? #5260

chucklu opened this issue Sep 22, 2021 · 2 comments
Labels
issue bankruptcy Closing the issue/PR to start fresh

Comments

@chucklu
Copy link

chucklu commented Sep 22, 2021

asp-fallback-test
The script method defined in the primary script to use for the fallback test. For more information, see FallbackTestExpression.

I am trying to use asp-fallback-test attribute to check if the script from cdn is loaded with integrity check.
Currently we use window.jQuery for jQuery and use window.axios for https://cdn.bootcdn.net/ajax/libs/axios/0.19.2/axios.min.js as the asp-fallback-test.

Related references
https://stackoverflow.com/questions/40626754/how-to-use-fallback-source-on-scripttaghelper-and-linktaghelper-correctly
aspnet/Mvc#1576
aspnet/Mvc#1580

@chucklu
Copy link
Author

chucklu commented Sep 22, 2021

Currently we are using _.assign as ap-fallback-test value, I am not sure if it's the best practice.
And why you did not export this js library to window as the other libraries did? Maybe something like window.lodash

@aprofessionalpirate
Copy link

_.assign did not work for me (it causes Uncaught ReferenceError: _ is not defined if the lodash js file is not found) however simply window._ seems to work well for me.

@jdalton jdalton added the issue bankruptcy Closing the issue/PR to start fresh label Sep 16, 2023
@jdalton jdalton closed this as completed Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue bankruptcy Closing the issue/PR to start fresh
Development

No branches or pull requests

3 participants