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

link crossorigin property must be camelCased #20

Open
mdevol58 opened this issue Aug 17, 2023 · 5 comments
Open

link crossorigin property must be camelCased #20

mdevol58 opened this issue Aug 17, 2023 · 5 comments

Comments

@mdevol58
Copy link

Please check that your issue is not already in the errata aka list of corrections and improvements. Please note that PRs will be ignored because code in the repo must match the print book already published. Please raise an issue instead so I can handle it appropriately. All issues will be entered into the errata once closed and fixed in the next book edition.

Chapter: 16
Page Number: 578
Section Title: Building Blazor components
Problem to fix: While troubleshooting why the Delete Database dialog box wouldn't open, I found an error message in the Developer Tools Console tab that contained the following - "... resource requires the request to be CORS enabled to check the integrity ...". Searching for this I found a post on StackOverflow stating that this is most likely caused by the crossOrigin property in the link element not properly camelCased. Once I corrected the links for bootstrap.min.css and bootstrap.min.js, the Delete Database dialog box started working properly.
Suggested solution: In step 17, fix the crossorigin property in the 2 new link elements so that it is crossOrigin.
Other useful information e.g. OS, coding tools, and so on:

@markjprice
Copy link
Owner

What browser and OS are you using? I've tested the code with Chrome and Edge and Firefox and none complain about the crossorigin attribute. Official documentation uses crossorigin. So does the Bootstrap template that I copied the link from.
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin

@markjprice
Copy link
Owner

Do you remember the stackoverflow article you read about it? Is it this one? https://stackoverflow.com/questions/69377275/typescript-font-import-error-with-link-tag-property-crossorigin
If so, note it has been closed as not reproducible and anyway seems to only apply to JSX/React.

@mdevol58
Copy link
Author

mdevol58 commented Aug 17, 2023 via email

@markjprice
Copy link
Owner

I suspect it was some other problem that caused the error and it is a coincidence that changing the casing fixed it. Also note that the StackOverflow article is about using JavaScript to set the attribute rather than setting it directly and for that I suspect an issue with the JavaScript interpretor because JavaScript is more strongly case-senstive and uses camel casing. HTML shouldn't care about casing. Web development is a mystery sometimes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants